Ensurepass.com : Ensure you pass the IT Exams
2018 Jan Oracle Official New Released 1z0-854
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-854.html
Java Standard Edition 5 Programmer Certified Professional Upgrade Exam
Question No: 51
Given:
11. Float pi = new Float(3.14f);
12. if (pi gt; 3) {
13. System.out.print(quot;pi is bigger than 3. quot;);
14. }
-
else {
-
System.out.print(quot;pi is not bigger than 3. quot;);
17. }
-
finally {
-
System.out.println(quot;Have a nice day.quot;);
20. }
What is the result?
-
An exception occurs at runtime.
-
pi is bigger than 3. Have a nice day.
-
Compilation fails.
-
pi is not bigger than 3. Have a nice day.
-
pi is bigger than 3.
Answer: C
Question No: 52
Given:
-
class Line {
-
public static class Point {}
12. } 13.
-
class Triangle {
-
// insert code here
16. }
Which code, inserted at line 15, creates an instance of the Point class defined in Line?
-
Line.Point p = new Line.Point();
-
The Point class cannot be instatiated at line 15.
-
Point p = new Point();
-
Line l = new Line() ; l.Point p = new l.Point();
Answer: A
Question No: 53
Given:
-
String csv = quot;Sue,5,true,3quot;;
-
Scanner scanner = new Scanner( csv );
-
scanner.useDelimiter(quot;,quot;);
-
int age = scanner.nextInt(); What is the result?
-
After line 15, the value of age is 3.
-
After line 15, the value of age is 5.
-
Compilation fails.
-
An exception is thrown at runtime.
Answer: D
Question No: 54 DRAG DROP
Click the Task button.
Answer:
Question No: 55
Given:
-
interface DeclareStuff {
-
public static final int EASY = 3;
-
void doStuff(int t); }
-
public class TestDeclare implements DeclareStuff {
-
public static void main(String [] args) {
-
int x = 5;
-
new TestDeclare().doStuff( x);
18. }
-
void doStuff(int s) {
-
s = EASY s;
-
System.out.println(quot;s quot; s);
22. }
23. }
What is the result?
-
Compilation fails.
-
s 10
-
s 16
-
s 14
-
An exception is thrown at runtime.
Answer: A
Question No: 56
Given:
-
public class Target {
-
private int i = 0;
-
public int addOne(){
-
return i; 5. }
-
6. }
And:
-
public class Client {
-
public static void main(String[] args){
-
System.out.println(new Target().addOne());
4. }
5. }
Which change can you make to Target without affecting Client?
-
Line 2 of class Target can be changed to private Integer i = 0;
-
Line 2 of class Target can be changed to private int i = 1;
-
Line 4 of class Target can be changed to return i ;
-
Line 3 of class Target can be changed to private int addOne(){
Answer: A
Question No: 57
Given:
-
package geometry;
-
public class Hypotenuse {
-
public InnerTriangle it = new InnerTriangle();
-
class InnerTriangle {
-
public int base;
-
public int height; 7. }
8. }
Which statement is true about the class of an object that can reference the variable base?
-
The class must be a subclass of the class Hypotenuse.
-
It can be any class.
-
No class has access to base.
-
The class must belong to the geometry package.
-
-
-
Answer: D
Question No: 58 DRAG DROP
Click the Task button.
Answer:
Question No: 59
Given:
int[] myArray = new int[] {1, 2, 3, 4, 5};
What allows you to create a list from this array?
-
List myList = myArray.asList();
-
List myList = new ArrayList(myArray);
-
List myList = Collections.fromArray(myArray);
-
List myList = Arrays.asList(myArray);
Answer: D
Question No: 60
Given:
10: public class Hello { 11: String title;
12: int value;
13: public Hello() { 14: title = quot; Worldquot;; 15: }
16: public Hello(int value) { 17: this.value = value;
18: title = quot;Helloquot;; 19: Hello();
20: }
21: }
and:
30: Hello c = new Hello(5); 31: System.out.println(c.title);
What is the result?
-
An exception is thrown at runtime.
-
Compilation fails.
-
Hello World 5
-
The code runs with no output.
-
Hello
-
Hello World
Answer: B
100% Ensurepass Free Download!
–Download Free Demo:1z0-854 Demo PDF
100% Ensurepass Free Guaranteed!
–1z0-854 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