I came across something like
ArgProcessor argProcessor = runWebApp.new ArgProcessor(options);
This line is from the source of GWT. By digging into Java's grammar I found it to be (".new") inner creator.
But I didn't find any proper documentation about why exactly we need the inner creator.
How does this differ from a normal object/instance creator?
It is for creating an object of the inner class type.
for example: look at this
http://www.javabeat.net/tips/124-inner-classes-in-java.html
ie:
class Outer{
final int z=10;
class Inner extends HasStatic {
static final int x = 3;
static int y = 4;
}
public static void main(String[] args) {
Outer outer=new Outer();
System.out.println(outer.new Inner().y);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With