Winter Special Sale - Limited Time 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 575363r9

Welcome To DumpsPedia

1z0-819 Sample Questions Answers

Questions 4

Which interface in the java.util.function package can return a primitive type?

Options:

A.

ToDoubleFunction

B.

Supplier

C.

BiFunction

D.

LongConsumer

Buy Now
Questions 5

Given:

What is the output?

Options:

A.

1 2 [1, 2, 3, four] 3 four

B.

1 2 [1, 2, 3, 4] 3 4

C.

1 2 [1, 2, 3, 4] 3 four

D.

1 2 [1, 2, 3, four] 3 4

Buy Now
Questions 6

Given:

Which is true about line 1?

Options:

A.

If the value is not present, a NoSuchElementException is thrown at run time.

B.

It always executes the System.out::print statement.

C.

If the value is not present, a NullPointerException is thrown at run time.

D.

If the value is not present, nothing is done.

Buy Now
Questions 7

Which two describe reasons to modularize the JDK? (Choose two.)

Options:

A.

easier to understand the Java language

B.

improves security and maintainability

C.

easier to expose implementation details

D.

improves application robustness

E.

easier to build a custom runtime linking application modules and JDK modules

Buy Now
Questions 8

Given:

Which statement is true?

Options:

A.

Class Tester does not need to import java.time.LocalDate because it is already visible to members of the package test.

B.

All classes from the package java.time. are loaded for the class Diary.

C.

Only LocalDate class from java.time package is loaded.

D.

Tester must import java.time.LocalDate in order to compile.

Buy Now
Questions 9

Given:

What is the result?

Options:

A.

The compilation fails.

B.

abdf

C.

abd

D.

adf

E.

abcd

Buy Now
Questions 10

Given:

What is the result?

Options:

A.

6910 3

B.

10126 3

C.

3

D.

6104 3

Buy Now
Questions 11

Analyze the code:

Which two options can you insert inside println method to produce Global:namescope? (Choose two.)

Options:

A.

Test.prefix+Test.name

B.

new Test().prefix+new Test().name

C.

Test.prefix+Test.getName()

D.

Test.getName+prefix

E.

prefix+Test.name

F.

prefix+name

Buy Now
Questions 12

Given:

What is the result?

Options:

A.

42

B.

The compilation fails due to an error in line 4.

C.

17

D.

The compilation fails due to an error in line 3.

E.

The compilation fails due to an error in line 2.

F.

The compilation fails due to an error in line 1.

G.

The compilation fails due to an error in line 5.

Buy Now
Questions 13

Given:

After which line can we insert assert i < 0 || values[i] <= values[i + 1]; to verify that the

values array is partially sorted?

Options:

A.

after line 8

B.

after line 6

C.

after line 5

D.

after line 10

Buy Now
Questions 14

Given:

This code results in a compilation error.

Which code should be inserted on line 1 for a successful compilation?

Options:

A.

Consumer consumer = msg -> { return System.out.print(msg); };

B.

Consumer consumer = var arg −> {System.out.print(arg);};

C.

Consumer consumer = (String args) −> System.out.print(args);

D.

Consumer consumer = System.out::print;

Buy Now
Questions 15

Given:

A) An exception is thrown at run time.

B)

C) The compilation fails due to an error on line 2.

D) The compilation fails due to an error on line 1.

E)

F)

The compilation fails due to an error on line 3.

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

F.

Option F

Buy Now
Questions 16

Examine these module declarations:

Which two statements are correct? (Choose two.)

Options:

A.

The ServiceProvider module is the only module that, at run time, can provide the com.example.api API.

B.

The placement of the com.example.api API in a separate module, ServiceAPI, makes it easy to install multiple provider modules.

C.

The Consumer module should require the ServiceProvider module.

D.

The ServiceProvider module should export the com.myimpl package.

E.

The ServiceProvider module does not know the identity of a module (such as Consumer) that uses the

com.example.api API.

Buy Now
Questions 17

Given:

Which loop incurs a compile time error?

Options:

A.

the loop starting line 11

B.

the loop starting line 7

C.

the loop starting line 14

D.

the loop starting line 3

Buy Now
Questions 18

Given:

and

checkQuality(QUALITY.A);

and

Which code fragment can be inserted into the switch statement to print Best?

Options:

A.

QUALITY.A.ValueOf()

B.

A

C.

A.toString()

D.

QUALITY.A

Buy Now
Questions 19

Given:

and

Which two method definitions at line n1 in the Bar class compile? (Choose two.)

Options:

A.

public List foo(Set m) {...}

B.

public List foo(Set m) {...}

C.

public List foo(TreeSet m) {...}

D.

public List foo(Set m) {...}

E.

public ArrayList foo(Set m) {...}

F.

public ArrayList foo(Set m) {...}

Buy Now
Questions 20

Given:

Which two independent changes will make the Main class compile? (Choose two.)

Options:

A.

Move the entire Student class declaration to a separate Java file, Student.java.

B.

Change line 2 to public Student(String classname).

C.

Change line 1 to public class Student {.

D.

Change line 3 to Student student = new Student(“Biology”);.

E.

Change line 1 to static class Student {.

Buy Now
Questions 21

Given the code fragment:

What is the result?

Options:

A.

EUR -> 0.84

GBP -> 0.75

USD -> 1.00

CNY -> 6.42

B.

The compilation fails.

C.

CNY -> 6.42

EUR -> 0.84

GBP -> 0.75

USD -> 1.00

D.

USD -> 1.00

GBP -> 0.75

EUR -> 0.84

CNY -> 6.42

Buy Now
Questions 22

You replace the code on line 1 to use ParallelStream.

Which one is correct?

Options:

A.

The code will produce the same result.

B.

The compilation fails.

C.

A NoSuchElementException is thrown at run time.

D.

The code may produce a different result.

Buy Now
Questions 23

Given:

Which two codes, independently, can be inserted in line to 1 compile?

Options:

A.

Abacus aba = (int m, int n) -> { m * n };

B.

Abacus aba = (int e, int f) -> { return e * f; };

C.

Abacus aba = (a, b) -> a * b;

D.

Abacus aba = v, w -> x * y;

E.

Abacus aba = (int i, j) -> ( return i * j; };

Buy Now
Questions 24

Given an application with a main module that has this module-info.java file:

Which two are true? (Choose two.)

Options:

A.

A module providing an implementation of country.CountryDetails can be compiled and added without recompiling the main module.

B.

A module providing an implementation of country.CountryDetails must have a requires main; directive in its module-info.java file.

C.

An implementation of country.countryDetails can be added to the main module.

D.

To compile without an error, the application must have at least one module in the module source path that provides an implementation of country.CountryDetails.

E.

To run without an error, the application must have at least one module in the module path that provides an implementation of country.CountryDetails.

Buy Now
Questions 25

Given the declaration:

Examine this code fragment:

/* Loc1 */ class ProcessOrders { ... }

Which two annotations may be applied at Loc1 in the code fragment? (Choose two.)

Options:

A.

@Resource(priority=100)

B.

@Resource(priority=0)

C.

@Resource(name=“Customer1”, priority=100)

D.

@Resource(name=“Customer1”)

E.

@Resource

Buy Now
Questions 26

Given the code fragment:

What is the result?

Options:

A.

23

B.

12

C.

123

D.

13

Buy Now
Questions 27

Given the code fragment:

You want to display the value of currency as $100.00.

Which code inserted on line 1 will accomplish this?

Options:

A.

NumberFormat formatter = NumberFormat.getInstance(locale).getCurrency();

B.

NumberFormat formatter = NumberFormat.getCurrency(locale);

C.

NumberFormat formatter = NumberFormat.getInstance(locale);

D.

NumberFormat formatter = NumberFormat.getCurrencyInstance(locale);

Buy Now
Questions 28

Given the code fragment:

What is the result?

Options:

A.

13 5 7 9

B.

1 3 5 7 9 11

C.

2 4 6 B 10

D.

2 4 6 8

Buy Now
Questions 29

A company has an existing Java app that includes two Java 8 jar files, sales-3.10. jar and clients-10.2.jar.

The jar file ,sales -8, 10, jar reference packages in clients -10.2 jar, but clients-10.2 jar does not reference packages in sales -8.10, jar.

They have decided to modularize clients-10.2.jar.

Which module-info. Java file would work for the new library version clients-10.3 jar?

A)

B)

C)

D)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 30

Assume ds is a DataSource and the EMP table is defined appropriately.

What does executing this code fragment do?

Options:

A.

inserts two rows (101, 'SMITH', 'HR') and (102, 'JONES', NULL)

B.

inserts two rows (101, 'SMITH', 'HR') and (102, 'JONES', 'HR')

C.

inserts one row (101, 'SMITH', 'HR')

D.

throws a SQLException

Buy Now
Questions 31

Given:

Which two interfaces can be used in lambda expressions? (Choose two.)

Options:

A.

MyInterface1

B.

MyInterface3

C.

MyInterface5

D.

MyInterface2

E.

MyInterface4

Buy Now
Questions 32

Assuming the Widget class has a getPrice method, this code does not compile:

Which two statements, independently, would allow this code to compile? (Choose two.)

Options:

A.

Replace line 5 with widgetStream.filter(a −> ((Widget)a).getPrice() > 20.00).

B.

Replace line 1 with List widgetStream = widgets.stream();.

C.

Replace line 5 with widgetStream.filter((Widget a) −> a.getPrice() > 20.00).

D.

Replace line 4 with Stream widgetStream = widgets.stream();.

Buy Now
Questions 33

Given:

Which two statements are true if the method is added to Bar? (Choose two.)

Options:

A.

public Collection foo(Collection arg) { ... } overrides Foo.foo.

B.

public Collection foo(Stream arg) { ... } overloads Foo.foo.

C.

public List foo(Collection arg) { ... } overrides Foo.foo.

D.

public Collection foo(Collection arg) { ... } overloads Foo.foo.

E.

public Collection bar(Collection arg) { ... } overloads Foo.foo.

F.

public Iterable foo(Collection arg) { ... } overrides Foo.foo.

Buy Now
Questions 34

Given the code fragment:

Which “for” loop produces the same output?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 35

Given:

What is the result?

Options:

A.

The compilation fails.

B.

1.99,2.99,0

C.

1.99,2.99,0.0

D.

1.99,2.99

Buy Now
Questions 36

Which command line runs the main class com.acme.Main from the module com.example?

Options:

A.

java --module-path mods com.example/com.acme.Main

B.

java –classpath com.example.jar com.acme.Main

C.

java --module-path mods -m com.example/com.acme.Main

D.

java -classpath com.example.jar –m com.example/com.acme.Main

Buy Now
Questions 37

Given the code fragment:

Which code fragment replaces the for statement?

Options:

A.

IntStream.rangeClosed(l, 100).map(FizzBuzz::convert).forEach(System.out::println);

B.

IntStream.ranged, 100).map(FizzBuzz::convert).forEach(System.out::println);

C.

intstream.rangeclosed(l, 100).mapToObj{FizzBuzz::convert).forEach(System.out::printIn);

D.

IntStream.range(1, 100).mapToObj(FizzBuzz::convert).forEach(System.out::println);

Buy Now
Questions 38

Given:

What is the result?

Options:

A.

null

B.

nothing

C.

It fails to compile.

D.

java.lang.IllegalAccessException is thrown.

E.

Student

Buy Now
Questions 39

Given the code fragment:

Which two statement inserted independently at line 1 enable this code to print PRRT?

Options:

A.

i—;

B.

continue b;

C.

break b;

D.

j--;

E.

continue a;

F.

break a ;

Buy Now
Questions 40

Given this enum declaration:

Examine this code:

System.out.println(Letter.values()[1]);

What code should be written at line 5 for this code to print 200?

Options:

A.

public String toString() { return String.valueOf(ALPHA.v); }

B.

public String toString() { return String.valueOf(Letter.values()[1]); }

C.

public String toString() { return String.valueOf(v); }

D.

String toString() { return “200”; }

Buy Now
Questions 41

Which two statements are correct about modules in Java? (Choose two.)

Options:

A.

java.base exports all of the Java platforms core packages.

B.

module-info.java can be placed in any folder inside module-path.

C.

A module must be declared in module-info.java file.

D.

module-info.java cannot be empty.

E.

By default, modules can access each other as long as they run in the same folder.

Buy Now
Questions 42

Given the contents:

MessageBundle.properties file:

message=Hello

MessageBundle_en.properties file:

message=Hello (en)

MessageBundle_US.properties file:

message=Hello (US)

MessageBundle_en_US.properties file:

message=Hello (en_US)

MessageBundle_fr_FR.properties file:

message=Bonjour

and the code fragment:

Locale.setDefault(Locale.FRANCE);

Locale currentLocale = new Locale.Builder().setLanguage(“en”).build();

ResourceBundle messages = ResourceBundle.getBundle(“MessageBundle”, currentLocale);

System.out. println(messages.getString(“message”));

Which file will display the content on executing the code fragment?

Options:

A.

MessageBundle_en_US.properties

B.

MessageBundle_en.properties

C.

MessageBundle_fr_FR.properties

D.

MessageBundle_US.properties

E.

MessageBundle.properties

Buy Now
Questions 43

Given:

and the code fragment:

Which two Map objects group all employees with a salary greater than 30 by neighborhood? (Choose two.)

A)

B)

C)

D)

E)

Options:

A.

Option

B.

Option

C.

Option

D.

Option

Buy Now
Questions 44

Given:

Which two lines cause compilation errors? (Choose two.)

Options:

A.

line 12

B.

line 6

C.

line 9

D.

line 8

E.

line 7

Buy Now
Questions 45

Which code fragment added to line 1 enables the code to compile and print Hello Joe?

A)

B)

C)

D)

Options:

Buy Now
Questions 46

Given:

Which statement is true about the Fox class?

Options:

A.

Fox class does not have to override inhabit method, so long as it does not try to call it.

B.

Fox class does not have to override the inhabit method if Forest and Town provide compatible implementations.

C.

Fox class must implement either Forest or Town interfaces, but not both.

D.

The inhabit method implementation from the first interface that Fox implements will take precedence.

E.

Fox class must provide implementation for the inhabit method.

Buy Now
Questions 47

Given:

What is the output?

Options:

A.

A compilation error is thrown.

B.

Message from Copier: Attempt00

C.

Message from Abstract Copier: Attempt00

D.

A runtime error is thrown.

Buy Now
Questions 48

Which three initialization statements are correct? (Choose three.)

Options:

A.

int[][][] e = {{1,1,1},{2,2,2}};

B.

short sh = (short)’A’;

C.

float x = 1f;

D.

byte b = 10;

char c = b;

E.

String contact# = “(+2) (999) (232)”;

F.

int x = 12_34;

G.

boolean false = (4 != 4);

Buy Now
Questions 49

Given the code fragment:

How many lines of text does this program print?

Options:

A.

four

B.

one

C.

three

D.

two

Buy Now
Questions 50

Given the code fragment:

What is the result?

Options:

A.

01

B.

0

C.

1

D.

The program prints nothing.

E.

It prints 1 in the infinite loop.

Buy Now
Questions 51

Given the formula to calculate a monthly mortgage payment:

and these declarations:

How can you code the formula?

Options:

A.

m = p * (r * Math.pow(1 + r, n) / (Math.pow(1 + r, n) - 1));

B.

m = p * ((r * Math.pow(1 + r, n) / (Math.pow(1 + r, n)) - 1));

C.

m = p * r * Math.pow(1 + r, n) / Math.pow(1 + r, n) - 1;

D.

m = p * (r * Math.pow(1 + r, n) / Math.pow(1 + r, n) - 1);

Buy Now
Questions 52

Which two statements set the default locale used for formatting numbers, currency, and percentages? (Choose two.)

Options:

A.

Locale.setDefault(Locale.Category.FORMAT, “zh-CN”);

B.

Locale.setDefault(Locale.Category.FORMAT, Locale.CANADA_FRENCH);

C.

Locale.setDefault(Locale.SIMPLIFIED_CHINESE);

D.

Locale.setDefault(“en_CA”);

E.

Locale.setDefault(“es”, Locale.US);

Buy Now
Questions 53

Which two are functional interfaces? (Choose two.)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Buy Now
Questions 54

Given:

Which two methods modify field values? (Choose two.)

Options:

A.

setAllCounts

B.

setACount

C.

setGCount

D.

setCCount

E.

setTCount

Buy Now
Questions 55

Given:

Which three classes successfully override printOne()? (Choose three.)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

F.

Option F

Buy Now
Questions 56

Given:

Which three actions implement Java SE security guidelines? (Choose three.)

Options:

A.

Change line 7 to return names.clone();.

B.

Change line 4 to this.names = names.clone();.

C.

Change the getNames() method name to get$Names().

D.

Change line 6 to public synchronized String[] getNames() {.

E.

Change line 2 to private final String[] names;.

F.

Change line 3 to private Secret(String[] names) {.

G.

Change line 2 to protected volatile String[] names;.

Buy Now
Questions 57

Your organization provides a cloud server to your customer to run their Java code. You are reviewing the changes for the next release and you see this change in one of the config files:

Which is correct?

Options:

A.

You accept the change because -noverify is necessary for your code to run with the latest version of Java.

B.

You reject the change because -Xms8g -Xmx8g uses too much system memory.

C.

You accept the change because -noverify is a standard option that has been supported since Java 1.0.

D.

You reject the change because -noverify is a critical security risk.

Buy Now
Questions 58

Given:

Which would cause s to be AQCD?

Options:

A.

s.replace(s.indexOf(“A”), s.indexOf(“C”), “Q”);

B.

s.replace(s.indexOf(“B”), s.indexOf(“C”), “Q”);

C.

s.replace(s.indexOf(“B”), s.indexOf(“B”), “Q”);

D.

s.replace(s.indexOf(“A”), s.indexOf(“B”), “Q”);

Buy Now
Questions 59

Given:

public class X {

}

and

public final class Y extends X {

}

What is the result of compiling these two classes?

Options:

A.

The compilation fails because there is no zero args constructor defined in class X.

B.

The compilation fails because either class X or class Y needs to implement the toString() method.

C.

The compilation fails because a final class cannot extend another class.

D.

The compilation succeeds.

Buy Now
Questions 60

Given the code fragment:

Which two code snippets inserted independently inside println method print Mondial:domainmodel? (Choose two.)

Options:

A.

Main.prefix + Main.name

B.

prefix + getName

C.

Main.prefix + Main.getName()

D.

new Main().prefix + new Main().name

E.

prefix + name

F.

prefix + Main.name

Buy Now
Questions 61

Which interface in the java.util.function package will return a void return type?

Options:

A.

Supplier

B.

Predicate

C.

Function

D.

Consumer

Buy Now
Questions 62

Which is a proper JDBC URL?

Options:

A.

jdbe.mysql.com://localhost:3306/database

C.

http://localhost mysql.jdbc:3306/database

D.

jdbc:mysql://localhost:3306/database

Buy Now
Questions 63

Given:

You want to obtain the Stream object on reading the file. Which code inserted on line 1 will accomplish this?

Options:

A.

var lines = Files.lines(Paths.get(INPUT_FILE_NAME));

B.

Stream lines = Files.readAllLines(Paths.get(INPUT_FILE_NAME));

C.

var lines = Files.readAllLines(Paths.get(INPUT_FILE_NAME));

D.

Stream lines = Files.lines(INPUT_FILE_NAME);

Buy Now
Questions 64

Given:

Which statement is equivalent to line 1?

Options:

A.

double totalSalary = list.stream().map(e −> e.getSalary() * ratio).reduce (bo).ifPresent (p −> p.doubleValue());

B.

double totalSalary = list.stream().mapToDouble(e −> e.getSalary() * ratio).sum;

C.

double totalSalary = list.stream().map(Employee::getSalary * ratio).reduce (bo).orElse(0.0);

D.

double totalSalary = list.stream().mapToDouble(e −> e.getSalary() * ratio).reduce(starts, bo);

Buy Now
Questions 65

Given:

What is the result?

Options:

A.

Map: 0 Keys: 0 Values: 0

B.

The compilation fails.

C.

Map: 4 Keys: 4 Values: 4

D.

Map: 4 Keys: 0 Values: 0

E.

Map: 0 Keys: 4 Values: 4

Buy Now
Questions 66

Given the code fragment:

What is the result?

Options:

A.

2

B.

-1

C.

1

D.

-3

Buy Now
Questions 67

Given:

var fruits = List.of(“apple”, “orange”, “banana”, “lemon”);

You want to examine the first element that contains the character n. Which statement will accomplish this?

Options:

A.

String result = fruits.stream().filter(f −> f.contains(“n”)).findAny();

B.

fruits.stream().filter(f −> f.contains(“n”)).forEachOrdered(System.out::print);

C.

Optional result = fruits.stream().filter(f −> f.contains (“n”)).findFirst ();

D.

Optional result = fruits.stream().anyMatch(f −> f.contains(“n”));

Buy Now
Questions 68

Which two modules include APIs in the Java SE Specification? (Choose two.)

Options:

A.

java.logging

B.

java.desktop

C.

javafx

D.

jdk.httpserver

E.

jdk.jartool

Buy Now
Questions 69

Given:

What is the result?

Options:

A.

Orange Juice

B.

The compilation fails.

C.

Orange Juice Apple Pie Lemmon Ice Raspberry Tart

D.

The program prints nothing.

Buy Now
Questions 70

Given:

List list1 = new ArrayList<>();

list1.add(“A”);

list1.add(“B”);

List list2 = List.copyOf(list1);

list2.add(“C”);

List> list3 = List.of(list1, list2);

System.out.println(list3);

What is the result?

Options:

A.

[[A, B],[A, B]]

B.

An exception is thrown at run time.

C.

[[A, B], [A, B, C]]

D.

[[A, B, C], [A, B, C]]

Buy Now
Questions 71

Given the code fragment:

What is the result?

Options:

A.

-1 : 2

B.

2 : -1

C.

2 : 3

D.

3 : 0

Buy Now
Questions 72

Given:

What is the result?

Options:

A.

An indexOutofBoundsException is thrown at runtime.

B.

At once 0

C.

Hat at store 4

D.

At once 1

E.

Hat at store 1

Buy Now
Questions 73

Given:

Which statement on line 1 enables this code fragment to compile?

Options:

A.

Function function = String::toUpperCase;

B.

UnaryOperator function = s −> s.toUpperCase();

C.

UnaryOperator function = String::toUpperCase;

D.

Function function = m −> m.toUpperCase();

Buy Now
Questions 74

Given:

Which is true?

Options:

A.

The compilation fails due to an error in line 6.

B.

The compilation succeeds.

C.

The compilation fails due to an error in line 4.

D.

The compilation fails due to an error in line 10.

E.

The compilation fails due to an error in line 7.

F.

The compilation fails due to an error in line 9.

G.

The compilation fails due to an error in line 2.

Buy Now
Questions 75

Which two are successful examples of autoboxing? (Choose two.)

Options:

A.

String a = “A”;

B.

Integer e = 5;

C.

Float g = Float.valueOf(null);

D.

Double d = 4;

E.

Long c = 23L;

F.

Float f = 6.0;

Buy Now
Questions 76

Given:

and

What is the result?

Options:

A.

A NullPointerException is thrown at run time.

B.

The compilation fails.

C.

1

Null

null

D.

1

1

1

E.

A ClassCastException is thrown at run time.

Buy Now
Questions 77

Given:

LocalDate d1 = LocalDate.of(1997,2,7);

DateTimeFormatter dtf =

DateTimeFormatter.ofPattern( /*insert code here*/ );

System.out.println(dtf.format (d1));

Which pattern formats the date as Friday 7th of February 1997?

Options:

A.

“eeee dd+”th of”+ MMM yyyy”

B.

“eeee dd'th of' MMM yyyy”

C.

“eeee d+”th of”+ MMMM yyyy”

D.

“eeee d’th of’ MMMM yyyy”

Buy Now
Exam Code: 1z0-819
Exam Name: Java SE 11 Developer
Last Update: Nov 22, 2024
Questions: 296
$64  $159.99
$48  $119.99
$40  $99.99
buy now 1z0-819