Hi!
This questiom is from Sun Guoqiao's Mock Exam:
What is the output of trying to compile and run the following code?
(Select one correct answer)
public class Test014 extends Object
{
public static void main(
String args[])
{
System.out.println(Test014.Inner.j); //1
}
class Inner
{
final static int j = 10; //2
}
}
A: The code does not compile because of line //1.
B: The code does not compile because of line //2.
C: The code compiles and runs with output: 10.
D: The code compiles but cannot run.
The correct answer is C, but I believe that a inner class can not have a statics members, only static inner clas can have statics members. For this I think that the correct answer is B. Can someone explain me please.
thank you in advance.