1Z0-809 | The Update Guide To 1Z0-809 exam dumps


Q71. Given the code fragment: 

int b = 3; 

if ( !(b > 3)) { 

System.out.println("square "); 

}{ 

System.out.println("circle "); 

System.out.println("..."); 

What is the result? 

A. square... 

B. circle... 

C. squarecircle... 

D. Compilation fails. 

Answer:

Q72. Given: 

Book.java: 

public class Book { 

private String read(String bname) { return “Read” + bname } 

EBook.java: 

public class EBook extends Book { 

public class String read (String url) { return “View” + url } 

Test.java: 

public class Test { 

public static void main (String[] args) { 

Book b1 = new Book(); 

b1.read(“Java Programing”); 

Book b2 = new EBook(); 

b2.read(“http://ebook.com/ebook”); 

What is the result? 

A. Read Java Programming View http:/ ebook.com/ebook 

B. Read Java Programming Read http:/ ebook.com/ebook 

C. The EBook.java file fails to compile. 

D. The Test.java file fails to compile. 

Answer:

Q73. Given: What is the result? 

A. 100 210 

B. Compilation fails due to an error in line n1 

C. Compilation fails due to an error at line n2 

D. Compilation fails due to an error at line n3 

Answer:

Q74. Given: 

1. 

abstract class Shape { 

2. 

Shape ( ) { System.out.println (“Shape”); } 

3. 

protected void area ( ) { System.out.println (“Shape”); } 

4. 

5. 

6. 

class Square extends Shape { 

7. 

int side; 

8. 

Square int side { 9./* insert code here */ 

10. 

this.side = side; 

11. 

12. 

public void area ( ) { System.out.println (“Square”); } 

13. 

14. 

class Rectangle extends Square { 

15. 

int len, br; 

16. 

Rectangle (int x, int y) { 

17. 

/* insert code here */ 

18. 

len = x, br = y; 

19. 

20. 

void area ( ) { System.out.println (“Rectangle”); } 

21. 

Which two modifications enable the code to compile? 

A. At line 1, remove abstract 

B. At line 9, insert super ( ); 

C. At line 12, remove public 

D. At line 17, insert super (x); 

E. At line 17, insert super (); super.side = x; 

F. At line 20, use public void area ( ) { 

Answer: C,D 

Q75. Given the code fragment: 

Stream<Path> files = Files.walk(Paths.get(System.getProperty(“user.home”))); 

files.forEach (fName -> {//line n1 

try { 

Path aPath = fName.toAbsolutePath();//line n2 

System.out.println(fName + “:” 

+ Files.readAttributes(aPath, Basic.File.Attributes.class).creationTime 

()); 

} catch (IOException ex) { 

ex.printStackTrace(); 

}); 

What is the result? 

A. All files and directories under the home directory are listed along with their attributes. 

B. A compilation error occurs at line n1. 

C. The files in the home directory are listed along with their attributes. 

D. A compilation error occurs at line n2. 

Answer:

Q76. Given: 

A. X XX 

B. X Y X 

C. Y Y X 

D. Y YY 

Answer: