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

Given:

Which code, when inserted at one or more marked positions, would allow classes B and C to compile?

A.

@Override // position 3void x () {} // position 3@Override // position 3public void z() { } // position 3

B.

@Override // position 2public void z() { } // position 3

C.

implements A // position 1@Override // position 2

D.

public void z() { } // position 3

Which describes an aspect of Java that contributes to high performance?

A.

Java prioritizes garbage collection.

B.

Java has a library of built-in functions that can be used to enable pipeline burst execution.

C.

Java monitors and optimizes code that is frequently executed.

D.

Java automatically parallelizes code execution.

Given:

What is the result?

A.

Good Morning, Potter

B.

Good Night, Potter

C.

Good Morning, Harry

D.

Good Night, Harry

Given:

What is the result?

A.

234

B.

2134

C.

3241

D.

214

Given:

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

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

Given:

What is the result?

A.

A java.util.NoSuchElementException is thrown at run time.

B.

Ans : a

C.

The compilation fails.

D.

Ans :

Given:

You want the code to produce this output:

John

Joe

Jane

Which code fragment should be inserted on line 1 and line 2 to produce the output?

A.

Insert Comparator on line 1.

Insert

public int compare(Person p1, Person p2) {

return p1.name.compare(p2.name);

}

on line 2.

B.

Insert Comparator on line 1.

Insert

public int compareTo(Person person) {

return person.name.compareTo(this.name);

}

on line 2.

C.

Insert Comparable on line 1.

Insert

public int compare(Person p1, Person p2) {

return p1.name.compare(p2.name);

}

on line 2.

D.

Insert Comparator on line 1.

Insert

public int compare(Person person) {

return person.name.compare(this.name);

}

on line 2.

Given the content from the course.txt file:

Which code fragment at line 1 prints the lines that contain Java from the course.txt file?

A)

B)

C)

D)

E)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Given:

Which one is correct?

A.

An IllegalThreadStateException is thrown at run time.

B.

Three threads are created.

C.

The compilation fails.

D.

Four threads are created.

Given this enum declaration:

Examine this code:

System.out.println(Alphabet.getFirstLetter());

What code should be written at line 3 to make this code print A?

A.

final String getFirstLetter() { return A.toString(); }

B.

static String getFirstLetter() { return Alphabet.values()[1].toString(); }

C.

static String getFirstLetter() { return A.toString(); }

D.

String getFirstLetter() { return A.toString(); }