Weekend Special 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: Board70

1z0-809 Exam Dumps - Oracle Java SE Questions and Answers

Question # 4

Given:

public class Canvas implements Drawable {

public void draw () { }

}

public abstract class Board extends Canvas { }

public class Paper extends Canvas {

protected void draw (int color) { }

}

public class Frame extends Canvas implements Drawable {

public void resize () { }

}

public interface Drawable {

public abstract void draw ();

}

Which statement is true?

Options:

A.

Board does not compile.

B.

Paper does not compile.

C.

Frame does not compile.

D.

Drawable does not compile.

E.

All classes compile successfully.

Buy Now
Question # 5

Given:

Which option fails?

Options:

A.

Foo mark = new Foo (“Steve”, 100);

B.

Foo pair = Foo.twice (“Hello World!”);

C.

Foo percentage = new Foo(“Steve”, 100);

D.

Foo grade = new Foo <> (“John”, “A”);

Buy Now
Question # 6

Given the code fragment:

List empDetails = Arrays.asList(“100, Robin, HR”, “200, Mary, AdminServices”,“101, Peter, HR”);

empDetails.stream()

.filter(s-> s.contains(“r”))

.sorted()

.forEach(System.out::println); //line n1

What is the result?

Options:

A.

100, Robin, HR101, Peter, HR

B.

E. A compilation error occurs at line n1.

C.

101, Peter, HR200, Mary, AdminServices

D.

100, Robin, HR200, Mary, AdminServices101, Peter, HR

Buy Now
Question # 7

Given the content of /resourses/Message.properties:

welcome1=”Good day!”

and given the code fragment:

Properties prop = new Properties ();

FileInputStream fis = new FileInputStream (“/resources/Message.properties”);

prop.load(fis);

System.out.println(prop.getProperty(“welcome1”));

System.out.println(prop.getProperty(“welcome2”, “Test”));//line n1

System.out.println(prop.getProperty(“welcome3”));

What is the result?

Options:

A.

Good day!Testfollowed by an Exception stack trace

B.

Good day!followed by an Exception stack trace

C.

Good day!Testnull

D.

A compilation error occurs at line n1.

Buy Now
Question # 8

Given the code fragment:

public static void main (String [ ] args) throws IOException {

BufferedReader br = new BufferedReader (new InputStremReader (System.in));

System.out.print (“Enter GDP: “);

//line 1

}

Which code fragment, when inserted at line 1, enables the code to read the GDP from the user?

Options:

A.

int GDP = Integer.parseInt (br.readline());

B.

int GDP = br.read();

C.

int GDP = br.nextInt();

D.

int GDP = Integer.parseInt (br.next());

Buy Now
Question # 9

Given the code fragment:

List list1 = Arrays.asList(10, 20);

List list2 = Arrays.asList(15, 30);

//line n1

Which code fragment, when inserted at line n1, prints 10 20 15 30?

Options:

A.

Stream.of(list1, list2).flatMap(list -> list.stream()).forEach(s -> System.out.print(s + “ “));

B.

Stream.of(list1, list2).flatMap(list -> list.intStream()).forEach(s -> System.out.print(s + “ “));

C.

list1.stream().flatMap(list2.stream().flatMap(e1 -> e1.stream()).forEach(s -> System.out.println(s + “ “));

D.

Stream.of(list1, list2).flatMapToInt(list -> list.stream()).forEach(s -> System.out.print(s + “ “));

Buy Now
Question # 10

Given:

Which two interfaces can you use to create lambda expressions? (Choose two.)

Options:

A.

T

B.

R

C.

P

D.

S

E.

Q

F.

U

Buy Now
Question # 11

Given the code fragment:

What is the result?

Options:

A.

Word: why what when

B.

Word: why Word: why what Word: why what when

C.

Word: why Word: what Word: when

D.

Compilation fails at line n1.

Buy Now
Question # 12

Given the definition of the Vehicle class:

Class Vehhicle {

int distance;//line n1

Vehicle (int x) {

this distance = x;

}

public void increSpeed(int time) {//line n2

int timeTravel = time;//line n3

class Car {

int value = 0;

public void speed () {

value = distance /timeTravel;

System.out.println (“Velocity with new speed”+value+”kmph”);

}

}

new Car().speed();

}

}

and this code fragment:

Vehicle v = new Vehicle (100);

v.increSpeed(60);

What is the result?

Options:

A.

Velocity with new speed

B.

A compilation error occurs at line n1.

C.

A compilation error occurs at line n2.

D.

A compilation error occurs at line n3.

Buy Now
Question # 13

Given the code fragments:

and

What is the result?

Options:

A.

FranceOptional[NotFound]

B.

Optional [France]Optional [NotFound]

C.

Optional[France]Not Found

D.

FranceNot Found

Buy Now
Exam Code: 1z0-809
Exam Name: Java SE 8 Programmer II
Last Update: Feb 23, 2025
Questions: 196
1z0-809 pdf

1z0-809 PDF

$25.5  $84.99
1z0-809 Engine

1z0-809 Testing Engine

$28.5  $94.99
1z0-809 PDF + Engine

1z0-809 PDF + Testing Engine

$40.5  $134.99