Read the following code excerpt carefully. //Contents of file A.java public
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 Answer are 4 and 5.
6.My question is when I run the program in the command line and listed how many class files are there? to get the answer 4.I got only one class file created.But here,how come the answer �Two class files corresponding to both inner classes (B) is created in the file system.�-is coming?Can anyone please explain?
Originally posted by Barry Gaunt: Because the printing of the "I am in the (no)-arg constructors" messages are not in the no-arg constructors! They are in instance initialization blocks of the constructors' local inner classes.
Oops...... I missed this line...
Well Thankx for reminding this line...
The Best way to predict your future is to create it - Every great individual common man
I think he's gonna try to grab my monkey. Do we have a monkey outfit for this tiny ad?
Free, earth friendly heat - from the CodeRanch trailboss