mercoledì 6 novembre 2013

Q38


Given the code fragment:

public class Employee {
String name;
transient String companyName;
}

 

import java.io.Serializable;

public class Manager extends Employee implements Serializable {

     String mgrId;

     public static void main(String s[]) throws Exception {

          Manager mgr = new Manager();

     }

}





What is the result?

A.
M001, ,

B.
M001, null, null

C.
M001, Sam,

D.
M001, Sam, null

E.
M001, Sam, ABC Inc

F.
Compilation fails

G.
A NullPointerException is thrown at Runtime

La risposta non c'è perché la domanda è probabilmente incompleta.

1 commento:

  1. May be Compilation fails if the two class are writed so appear there, if you copy and paste the text in a IDE there are problems with the second importation.
    but if the class are copy in separated files compile but is not output

    RispondiElimina