Ensurepass.com : Ensure you pass the IT Exams
2018 Jan Oracle Official New Released 1z0-851
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-851.html
Java Standard Edition 6 Programmer Certified Professional Exam
Question No: 81 – (Topic 1)
Click the Exhibit button. Which three code fragments, added individually at line 29, produce the output 100? (Choose three.)
A. n = 100;
-
i.setX( 100 );
-
o.getY().setX( 100 );
-
i = new Inner(); i.setX( 100 );
-
o.setY( i ); i = new Inner(); i.setX( 100 );
-
i = new Inner(); i.setX( 100 ); o.setY( i );
Answer: B,C,F
Question No: 82 – (Topic 1)
A developer is creating a class Book, that needs to access class Paper. The Paper class is deployed in a JAR named myLib.jar. Which three, taken independently, will allow the developer to use the Paper class while compiling the Book class? (Choose three.)
-
The JAR file is located at $JAVA_HOME/jre/classes/myLib.jar.
-
The JAR file is located at $JAVA_HOME/jre/lib/ext/myLib.jar..
-
The JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar/Paper.class.
-
The JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar.
-
The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -cp
/foo/myLib.jar/Paper Book.java.
-
The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -d
/foo/myLib.jar Book.java
-
The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac – classpath /foo/myLib.jar Book.java
Answer: B,D,G
Question No: 83 – (Topic 1)
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?
-
s 14
-
s 16
-
s 10
-
Compilation fails.
-
An exception is thrown at runtime.
Answer: D
Question No: 84 – (Topic 1)
Given:
-
public class Commander {
-
public static void main(String[] args) {
-
String myProp = /* insert code here */
-
System.out.println(myProp);
15. }
16. }
and the command line: java -Dprop.custom=gobstopper Commander Which two, placed on line 13, will produce the output gobstopper? (Choose two.)
-
System.load(quot;prop.customquot;);
-
System.getenv(quot;prop.customquot;);
-
System.property(quot;prop.customquot;);
-
System.getProperty(quot;prop.customquot;);
-
System.getProperties().getProperty(quot;prop.customquot;);
Answer: D,E
Question No: 85 – (Topic 1)
Given:
-
public class Spock {
-
public static void main(String[] args) {
-
Long tail = 2000L;
-
Long distance = 1999L;
-
Long story = 1000L;
-
if((tail gt; distance) ^ ((story * 2) == tail))
-
System.out.print(quot;1quot;);
-
if((distance 1 != tail) ^ ((story * 2) == distance))
-
System.out.print(quot;2quot;);
12. }
13. }
What is the result?
-
1
-
2
-
12
-
Compilation fails.
-
No output is produced.
-
An exception is thrown at runtime.
Answer: E
Question No: 86 – (Topic 1)
Given:
-
public class GC {
-
private Object o;
-
private void doSomethingElse(Object obj) { o = obj; }
-
public void doSomething() {
-
Object o = new Object();
-
doSomethingElse(o);
-
o = new Object();
-
doSomethingElse(null);
-
o = null;
10. }
11. }
When the doSomething method is called, after which line does the Object created in line 5 become available for garbage collection?
-
Line 5
-
Line 6
-
Line 7
-
Line 8
-
Line 9
-
Line 10
-
-
Answer: D
Question No: 87 – (Topic 1)
Click the Exhibit button. What is the result?
-
go in Goban go in Sente
-
go in Sente go in Goban
-
go in Sente go in Goban
-
go in Goban go in Sente
-
Compilation fails because of an error in line 17.
Answer: C
Question No: 88 – (Topic 1)
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 Tree() { Plant(); } is added to the Tree class.
-
The code will compile if public Plant() { Tree(); } 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 Plant() { Plant(quot;fernquot;); } is added to the Plant class.
-
Answer: D
Question No: 89 – (Topic 1)
Click the Exhibit button. Given:
-
A a = new A();
-
System.out.println(a.doit(4, 5)); What is the result?
-
Line 26 prints quot;aquot; to System.out.
-
Line 26 prints quot;bquot; to System.out.
-
An exception is thrown at line 26 at runtime.
-
Compilation of class A will fail due to an error in line 6.
Answer: A
Question No: 90 – (Topic 1)
Given:
11. public enum Title {
12. MR(quot;Mr.quot;), MRS(quot;Mrs.quot;), MS(quot;Ms.quot;);
-
private final String title;
-
private Title(String t) { title = t; }
-
public String format(String last, String first) {
-
return title quot; quot; first quot; quot; last;
17. }
18. }
-
public static void main(String[] args) {
-
System.out.println(Title.MR.format(quot;Doequot;, quot;Johnquot;));
21. }
What is the result?
-
Mr. John Doe
-
An exception is thrown at runtime.
-
Compilation fails because of an error in line 12.
-
Compilation fails because of an error in line 15.
-
Compilation fails because of an error in line 20.
Answer: A
100% Ensurepass Free Download!
–Download Free Demo:1z0-851 Demo PDF
100% Ensurepass Free Guaranteed!
–1z0-851 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