Question 91. Read the following code excerpt carefully. //Contents of file A.java Which of the following are true 1.A.java cannot be compiled. Duplicate defination of inner class B. 2.A.java compiles without any error. An attempt to run C as an application will cause runtime linkage error. Duplicate definations of inner class B are found 3.Only one class file corresponding to the inner class B is created in the file system. 4.Two class files corresponding to both inner classes (B) is created in the file system. 5.The classes compile cleanly and on running C as an application causes "I am in the arg constructor" to be printed on the console
the given ans is;4.5. I dont know why there there are two class file(A$1$B.class ,A$2$B.class)of class B is created when i compiled the code.
(Marilyn added code tags) [This message has been edited by Marilyn deQueiroz (edited November 03, 2001).]
the class file of the inner class will be also generated along with the generation of the driver's class. so in this case, A.java has two inner classes B in each of its constructors, therefore, two B.class will be generated. arthur