Given:
public class Basic{
private static int letter;
public static int getLetter();
public static void Main(String[] args) {
System.out.println(getLetter());
}
}
Why will the
code not compile?
A.
A static field cannot be private.
A static field cannot be private.
B.
The getLetter method has no body.
The getLetter method has no body.
C.
There is no setLetter method.
There is no setLetter method.
D.
The letter field is uninitialized.
The letter field is uninitialized.
E.
It contains a method named Main instead of main
It contains a method named Main instead of main
Risposta : B.
Nessun commento:
Posta un commento