File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Top level clases" Watch "Top level clases" New topic

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:
subject: Top level clases
It's not a secret anymore!