class A {
private static int counter;
public static int getCounter(){return counter++;}
private static int innerCounter;
public static int getInnerCounter(){return innerCounter++;}
private
String name;
A() {name = "A" + getCounter();}
class B {
private String name;
B() {
name = "B" + getInnerCounter();
System.out.print(A.this.name + name);
}}
void m1() {new A().new B();}
void m2()
{
new A.B();// 1
}
void m3() {new B();}
public static void main(String[] args) {
A a1 = new A();
a1.m1(); a1.m2(); a1.m3();
}}
i got the ouput right but
can anyone give the description of line 1,how is it read(i.e we r invoking on whichobject ....)
and then if u replace line 1 by {this.new B();} how is it read
i hope so u ppl got my question