♥♥ 2017 NEW RECOMMEND ♥♥

Free VCE & PDF File for Oracle 1z0-808 Real Exam (Full Version!)

★ Pass on Your First TRY ★ 100% Money Back Guarantee ★ Realistic Practice Exam Questions

Free Instant Download NEW 1z0-808 Exam Dumps (PDF & VCE):
Available on: http://www.surepassexam.com/1z0-808-exam-dumps.html

Q21. Given the code fragment: 

Which statement is true? 

A. After line 8, three objects are eligible for garbage collection 

B. After line 8, two objects are eligible for garbage collection 

C. After line 8, one object is eligible for garbage collection 

D. After line 8, none of the objects are eligible for garbage collection 

Answer:


Q22. Which of the following can fill in the blank in this code to make it compile? (Select 2 options.) 

A. On line 1, fill in throws 

B. On line 1, fill in throws new 

C. On line 2, fill in throw new 

D. On line 2, fill in throws 

E. On line 2, fill in throws new 

Answer: A,C 

Explanation: 

Option A and C are the correct answer. 

In a method declaration, the keyword throws is used. So here at line 1 we have to use 

option A. 

To actually throw an exception, the keyword throw is used and a new exception is created, 

so at line 2 we have to use throw and new keywords, which is option C. Finally it will look 

like; 

public void method() throws Exception { 

throw new Exception0; 

REFERENCE : httpsy/docs.oracle.com/javase/tutorial/essential/io/fileOps.html#exception 

The correct answer is: On line 1, fill in throws. On line 2, fill in throw new 


Q23. Given the content of three files: 

Which statement is true? Which statement is true? 

A. Only the A.Java file compiles successfully. 

B. Only the B.java file compiles successfully. 

C. Only the C.java file compiles successfully. 

D. The A.Java and B.java files compile successfully. 

E. The B.java and C.java files compile successfully. 

F. The A.Java and C.java files compile successfully. 

Answer:

Explanation: In class B.Java doStuff() has access modifier with variable name which is not allowed. C.Java class name is different than file name. Only private classes can have different names than file names 


Q24. Given the code fragment: 

Which two modifications should you make so that the code compiles successfully? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

E. Option E 

Answer: A,C 

Explanation: 

Add throws clause in both printFileContent and main. 


Q25. Given: 

class Mid { 

public int findMid(int n1, int n2) { 

return (n1 + n2) / 2; 

public class Calc extends Mid { 

public static void main(String[] args) { 

int n1 = 22, n2 = 2; 

// insert code here 

System.out.print(n3); 

Which two code fragments, when inserted at // insert code here, enable the code to compile and print 12? 

A. Calc c = new Calc(); int n3 = c.findMid(n1,n2); 

B. int n3 = super.findMid(n1,n3); 

C. Calc c = new Mid(); int n3 = c.findMid(n1, n2); 

D. Mid m1 = new Calc(); int n3 = m1.findMid(n1, n2); 

E. int n3 = Calc.findMid(n1, n2); 

Answer: A,D 

Explanation: 

Incorrect: 

Not B: circular definition of n3. 

Not C: Compilation error. line Calc c = new Mid(); 

required: Calc 

found: Mid 

Not E: Compilation error. line int n3 = Calc.findMid(n1, n2); 

non-static method findMid(int,int) cannot be referenced from a static context 


Q26. 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? 

A. Remove the area field. 

B. Change the getArea( ) method as follows: 

public double getArea ( ) { return Match.PI * radius * radius; } 

C. Add the following method: 

public double getArea ( ) {area = Match.PI * radius * radius; } 

D. Change the cacess modifier of the SerRadius ( ) method to be protected. 

Answer: B,D 


Q27. Given the code fragment: 

Which two modifications, when made independently, enable the code to print joe:true: 100.0? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

E. Option E 

Answer: A,C 


Q28. Given the code fragment: 

What is the result? 

A. 2 4 

B. 0 2 4 6 

C. 0 2 4 

D. Compilation fails 

Answer:


Q29. Given: 

class Sports { 

int num_players; 

String name, ground_condition; 

Sports(int np, String sname, String sground){ 

num_players = np; 

name = sname; 

ground_condition = sground; 

class Cricket extends Sports { 

int num_umpires; 

int num_substitutes; 

Which code fragment can be inserted at line //insert code here to enable the code to compile? 

A. Cricket() { 

super(11, "Cricket", "Condidtion OK"); 

num_umpires =3; 

num_substitutes=2; 

B. Cricket() { 

super.ground_condition = "Condition OK"; 

super.name="Cricket"; 

super.num_players = 11; 

num_umpires =3; 

num_substitutes=2; 

C. Cricket() { 

this(3,2); 

super(11, "Cricket", "Condidtion OK"); 

Cricket(int nu, ns) { 

this.num_umpires =nu; 

this.num_substitutes=ns; 

D. Cricket() { 

this.num_umpires =3; 

this.num_substitutes=2; 

super(11, "Cricket", "Condidtion OK"); 

Answer:

Explanation: 

Incorrect: 

not C, not D: call to super must be the first statement in constructor. 


Q30. Given: 

public class TestLoop1 { 

public static void main(String[] args) { 

int a = 0, z=10; 

while (a < z) { 

a++; 

--z; 

} System.out.print(a + " : " + z); } } 

What is the result? 

A. 5 : 5 

B. 6 : 4 

C. 6 : 5 

D. 5 : 4 

Answer: