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: 71
Given:
-
package com.sun.scjp;
-
public class Geodetics {
-
public static final double DIAMETER = 12756.32; // kilometers
13. }
Which two correctly access the DIAMETER member of the Geodetics class? (Choose two.)
-
import com.sun.scjp.Geodetics; public class TerraCarta {
public double halfway()
{ return Geodetics.DIAMETER/2.0; } }
-
import static com.sun.scjp.Geodetics; public class TerraCarta{
public double halfway() { return DIAMETER/2.0; } }
-
package com.sun.scjp; public class TerraCarta {
public double halfway() { return DIAMETER/2.0; } }
-
import static com.sun.scjp.Geodetics.*; public class TerraCarta {
public double halfway() { return DIAMETER/2.0; } }
Answer: A,D
Question No: 72
Given:
-
public class Test {
-
public enum Dogs {collie, harrier};
-
public static void main(String [] args) {
-
Dogs myDog = Dogs.collie;
-
switch (myDog) {
-
case collie:
-
System.out.print(quot;collie quot;);
-
case harrier:
-
System.out.print(quot;harrier quot;);
21. }
22. }
23. }
What is the result?
-
collie
-
Compilation fails.
-
collie harrier
-
An exception is thrown at runtime.
-
harrier
Answer: C
Question No: 73
Click the Exhibit button.
Which statement is true about the classes and interfaces in the exhibit?
-
Compilation of class AImpl will fail because of an error in line 2.
-
Compilation of class C will fail because of an error in line 2.
-
Compilation will succeed for all classes and interfaces.
-
Compilation of class C will fail because of an error in line 6.
Answer: D
Question No: 74
Given:
-
public class Ball{
-
public enum Color { RED, GREEN, BLUE };
-
public void foo(){
-
// insert code here
-
{ System.out.println(c); }
16. }
17. }
Which code inserted at line 14 causes the foo method to print RED, GREEN, and BLUE?
-
for( Color c : Color.values() )
-
for( Color c = Color[0]; c lt;= Color[2]; c )
-
for( Color c = Color.RED; c lt;= Color.BLUE; c )
-
for( Color c = RED; c lt;= BLUE; c )
-
for( Color c ; c.hasNext() ; c.next() )
Answer: A
Question No: 75
Which three statements are true? (Choose three.)
-
A public static method in class X can be called by a subclass of X without explicitly referencing the class X.
-
A method with the same signature as a private final method in class X can be implemented in a subclass of X.
-
A protected method in class X can be overridden by a subclass of A only if the subclass is in the same package as X.
-
A private static method can be called only within other static methods in class X.
-
A non-static public final method in class X can be overridden in any subclass of X.
-
A final method in class X can be abstract if and only if X is abstract.
-
A protected method in class X can be overridden by any subclass of X.
Answer: A,B,G
Question No: 76
Given:
-
String #name = quot;Jane Doequot;;
-
int $age = 24;
-
Double _height = 123.5;
-
double ~temp = 37.5;
Which two statements are true? (Choose two.)
-
Line 36 will not compile.
-
Line 37 will not compile.
-
Line 38 will not compile.
-
Line 35 will not compile.
Answer: C,D
Question No: 77
Given:
-
public class Plant {
-
private String name;
-
public Plant(String name) { this.name = name; }
-
public String getName() { return name; } 5. }
-
-
public class Tree extends Plant {
-
public void growFruit() { }
-
public void dropLeaves() { } 4. }
Which statement is true?
-
The code will compile without changes.
-
The code will compile if public Plant() { Plant(quot;fernquot;); } is added to the Plant class.
-
The code will compile if public Plant() { this(quot;fernquot;); } is added to the Plant class.
-
The code will compile if public Tree() { Plant(); } is added to the Tree class.
-
The code will compile if public Plant() { Tree(); } is added to the Plant class.
Answer: C
Question No: 78 DRAG DROP
Click the Task button.
Answer:
Question No: 79
Given:
-
public class Base {
-
public static final String FOO = quot;fooquot;;
-
public static void main(String[] args) {
-
Base b = new Base();
-
Sub s = new Sub();
-
System.out.print(Base.FOO);
-
System.out.print(Sub.FOO);
-
System.out.print(b.FOO);
-
System.out.print(s.FOO);
-
System.out.print(((Base)s).FOO); 11. } }
-
-
12. class Sub extends Base {public static final String FOO=quot;barquot;;} What is the result?
-
foofoofoobarbar
-
foofoofoofoofoo
-
foofoofoobarfoo
-
barbarbarbarbar
-
foobarfoobarbar
-
foobarfoofoofoo
-
foobarfoobarfoo
Answer: G
Question No: 80
Given:
-
interface DoStuff2 {
-
float getRange(int low, int high); } 3.
-
-
interface DoMore {
-
float getAvg(int a, int b, int c); } 6.
7. abstract class DoAbstract implements DoStuff2, DoMore { } 8.
-
class DoStuff implements DoStuff2 {
-
public float getRange(int x, int y) { return 3.14f; } } 11.
-
interface DoAll extends DoMore {
-
float getAvg(int a, int b, int c, int d); }
What is the result?
-
The file will compile without error.
-
Compilation fails. Lines 7, 12, and 13 contain errors.
-
Compilation fails. Only line 7 contains an error.
-
Compilation fails. Only lines 7 and 12 contain errors.
-
Compilation fails. Only line 12 contains an error.
-
Compilation fails. Only line 13 contains an error.
-
Compilation fails. Only lines 7 and 13 contain errors.
Answer: A
100% Ensurepass Free Download!
–Download Free Demo:1z0-854 Demo PDF
100% Ensurepass Free Guaranteed!
–1z0-854 DumpsEnsurePass 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 HOT CATEGORY!HOT EXAM!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