What is the result?

Given:

What is the result?

Given:

What is the result?

A.
Compilation succeeds.

B.
Compilation fails due to an error on line 1.

C.
Compilation fails due to an error on line 2.

D.
Compilation fails due to an error on line 3.

E.
Compilation fails due to an error on line 4.

F.
Compilation fails due to an error on line 8.

Explanation:



Leave a Reply 7

Your email address will not be published. Required fields are marked *


BKhateib

BKhateib

Not correct, the following compilation error appeared to me ::
Illegal modifier for the constructor in type FinalShow; only public, protected & private are permitted
in Line 6 and Line 3

BKhateib

BKhateib

Answer is D

l0c

l0c

A is the correct answer. No compile errors.

FinalShow.java:
final class FinalShow {
final String location;

FinalShow(String loc) {
location = loc;
}

FinalShow(String loc, String title) {
location = loc;
loc = “unknown”;
}
}

mknet

mknet

A >> no compile errors.

FF

FF

A, no errors! confirmed java 7 compiler

gelete

gelete

+1

A. Compilation succeeds

Klyaksa

Klyaksa

Answer is A