wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes public inner class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "public inner class" Watch "public inner class" New topic
Author

public inner class

Kush Kush
Greenhorn

Joined: Apr 27, 2004
Posts: 11
class Outer
{
public class Inner
{
//inner class code
}
public static void main(String lal[])
{
System.out.println("");
H h=new H();
Inner i=h.new Inner();
}

In above code what is the use of Public (non - static )Inner Class ?


Smile with JAVA
Peter Shipway
Ranch Hand

Joined: Mar 25, 2004
Posts: 71
I think that the code in the main method somehow relates to it, hence it being public im not sure on this the standard that i folllow is to use the static main class tpo to run another method eg
public static void main (Sting [] args) {
ProgramName tpo = new ProgramName();
tpo.nameofMethod();
}
 
Don't get me started about those stupid light bulbs.
 
subject: public inner class