|
Java™ by example!
|
|
|
How do I create an instance of an inner class from a static method of the outer class?
A static inner class can be instantiated without the need of an instance of the outer class. Main.java:
You need an instance of the outer class to instantiate a non-static inner class. Just specify it before the new operator. Main.java:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|