• 2022-06-07
    读代码:public class foo {static String s;public static void main (String[]args) {System.out.println (“s=” + s);}}结果是:
    A: The code compiles, but a NullPointerException is thrown when toString is called
    B: The code compiles and “s=null” is printed
    C: The code does not compile because string s cannot be referenced
    D: The code does not compile because string s is not initialized
    E: The code compiles and “s=” is printed