giovedì 28 marzo 2013

Q50


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.
B.
The getLetter method has no body.
C.
There is no setLetter method.
D.
The letter field is uninitialized.
E.
It contains a method named Main instead of main
Risposta : B.

Nessun commento:

Posta un commento