Ensurepass.com : Ensure you pass the IT Exams
2018 Jan Oracle Official New Released 1z0-803
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-803.html
Java SE 7 Programmer I
Question No: 31
Given:
-
X XX
-
X Y X
-
Y Y X
-
Y YY
Answer: D
Question No: 32
Given the code fragment:
-
ArrayListlt;Integergt; list = new ArrayListlt;gt;(1); 2. list.add(1001);
-
3. list.add(1002);
-
System.out.println(list.get(list.size())); What is the result?
-
Compilation fails due to an error on line 1.
-
An exception is thrown at run time due to error on line 3
-
Anexception is thrown at run time due to error on line 4
-
D. 1002
Answer: C Explanation:
The code compiles fine.
At runtime an IndexOutOfBoundsException is thrown when the second list item is added.
Question No: 33
Which code fragment is illegal?
-
Option A
-
Option B
-
Option C
-
Option D
Answer: D Explanation:
The abstract keyword cannot be used to declare an int variable.
The abstract keyword is used to declare a class or method to beabstract[3]. An abstract method has no implementation; all classes containing abstract methods must themselves be abstract, although not all abstract classes have abstract methods.
Question No: 34
Given:
Which two declarations will compile?
-
int a, b, c = 0;
-
int a, b, c;
-
int g, int h, int i = 0;
-
int d, e, F;
-
int k, l, m; = 0;
Answer: A,D
Question No: 35
Given:
The class is poorly encapsulated. You need to change the circle class to compute and return the area instead.
Which two modifications are necessary to ensure that the class is being properly encapsulated?
-
Remove the area field.
-
Change the getArea( ) method as follows:
public double getArea ( ) { return Match.PI * radius * radius; }
-
Add the following method:
public double getArea ( ) {area = Match.PI * radius * radius; }
-
Change the cacess modifier of the SerRadius ( ) method to be protected.
Answer: B,D
Question No: 36
Given:
What is the result?
-
Compilation fails
-
The code compiles, but does not execute.
-
Paildrome
-
Wow
-
Mom
Answer: B
Question No: 37
Given the code fragment:
Boolean b1 = true; Boolean b2 = false; int i = 0;
while (foo) { }
Which one is valid as a replacement for foo?
-
b1.compareTo(b2)
-
i = 1
C. i == 2? -1 : 0
D. quot;fooquot;.equals(quot;barquot;)
Answer: D Explanation:
Equals works fine on strings equals produces a Boolean value.
Question No: 38
Given:
public class TestLoop1 {
public static void main(String[] args) { int a = 0, z=10;
while (a lt; z) { a ;
-z;
}
System.out.print(a quot; : quot; z);
}
}
What is the result?
A. 5 : 5
B. 6 : 4
C. 6 : 5
D. 5 : 4
Answer: A
Question No: 39
Give:
What is the result?
A. 1525
-
13
-
Compilation fails
-
An exception is thrown at runtime
-
The program fails to execute due to runtime error
Answer: D
Question No: 40
Given:
public class MainMethod { void main() { System.out.println(quot;onequot;);
}
static void main(String args) { System.out.println(quot;twoquot;);
}
public static void main(String[] args) { System.out.println(quot;threequot;);
}
void mina(Object[] args) { System.out.println(quot;fourquot;);
}
}
What is printed out when the program isexcuted?
-
one
-
two
-
three
-
four
Answer: C
100% Ensurepass Free Download!
–Download Free Demo:1z0-803 Demo PDF
100% Ensurepass Free Guaranteed!
–1z0-803 Dumps
EnsurePass | ExamCollection | Testking | |
---|---|---|---|
Lowest Price Guarantee | Yes | No | No |
Up-to-Dated | Yes | No | No |
Real Questions | Yes | No | No |
Explanation | Yes | No | No |
PDF VCE | Yes | No | No |
Free VCE Simulator | Yes | No | No |
Instant Download | Yes | No | No |
100-105 Dumps VCE PDF
200-105 Dumps VCE PDF
300-101 Dumps VCE PDF
300-115 Dumps VCE PDF
300-135 Dumps VCE PDF
300-320 Dumps VCE PDF
400-101 Dumps VCE PDF
640-911 Dumps VCE PDF
640-916 Dumps VCE PDF
70-410 Dumps VCE PDF
70-411 Dumps VCE PDF
70-412 Dumps VCE PDF
70-413 Dumps VCE PDF
70-414 Dumps VCE PDF
70-417 Dumps VCE PDF
70-461 Dumps VCE PDF
70-462 Dumps VCE PDF
70-463 Dumps VCE PDF
70-464 Dumps VCE PDF
70-465 Dumps VCE PDF
70-480 Dumps VCE PDF
70-483 Dumps VCE PDF
70-486 Dumps VCE PDF
70-487 Dumps VCE PDF
220-901 Dumps VCE PDF
220-902 Dumps VCE PDF
N10-006 Dumps VCE PDF
SY0-401 Dumps VCE PDF