• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

public inner class

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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();
}
 
reply
    Bookmark Topic Watch Topic
  • New Topic