permaculture playing cards*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Top level clases Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Top level clases" Watch "Top level clases" New topic
Author

Top level clases

Milind Deodhar
Ranch Hand

Joined: Dec 06, 2000
Posts: 32
class Class2 {
static class Class3 {
}
}

public class Class1{
public static void main (String args[]) {
// Class3 c = new Class2.Class3();
}
}
What is the correct way of defining a top level nested class
For a non inner Class3, it can do like
Class2.Class3 c = new Class2().new Class3();
but what should be the syntax for top level nested class
umang bhartia
Ranch Hand

Joined: Sep 29, 2000
Posts: 60
u can access the toplevel nested class by calling

class2.class3 c = new class2.class3();
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Top level clases