Weekend Sale - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: sntaclus

Given:

Which is true about line 1?

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.

Given:

What is the result?

A.

2,34,34,5

B.

2,34,54,5

C.

2,54,54,5

D.

2,34,54,3

Given the code fragment:

What is the result?

A.

-1 : 2

B.

2 : -1

C.

2 : 3

D.

3 : 0

Given:

Which two lines inserted in line 1 will allow this code to compile? (Choose two.)

A.

protected void walk(){}

B.

void walk(){}

C.

abstract void walk();

D.

private void walk(){}

E.

public abstract void walk();

Given the code fragment:

Which code fragment replaces the for statement?

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);

Given:

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

values array is partially sorted?

A.

after line 8

B.

after line 6

C.

after line 5

D.

after line 10

Given the code fragment:

Path currentFile = Paths.get(“/scratch/exam/temp.txt”);

Path outputFile = Paths get(“/scratch/exam/new.txt”);

Path directory = Paths.get(“/scratch/”);

Files.copy(currentFile, outputFile);

Files.copy(outputFile, directory);

Files.delete (outputFile);

The /scratch/exam/temp.txt file exists. The /scratch/exam/new.txt and /scratch/new.txt files do not exist.

What is the result?

A.

/scratch/exam/new.txt and /scratch/new.txt are deleted.

B.

The program throws a FileaAlreadyExistsException.

C.

The program throws a NoSuchFileException.

D.

A copy of /scratch/exam/new.txt exists in the /scratch directory and /scratch/exam/new.txt is deleted.

Given:

List longlist = List.of(“Hello”,”World”,”Beat”);

List shortlist = new ArrayList<>();

Which code fragment correctly forms a short list of words containing the letter “e”?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Given:

What action ensures successful compilation?

A.

Replace public Color(int c) with private Color(int c).

B.

Replace int c; with private int c;.

C.

Replace int c; with private final int c;.

D.

Replace enum Color implements Serializable with public enum Color.

E.

Replace enum Color with public enum Color.

Given:

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

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.