Closed Thread
Results 1 to 2 of 2

Thread: help in class

  1. #1
    R3.RyozKidz Guest

    help in class

    1)what is the meaning of enclosing class...?

    2) public class ABC
    { private int a;
    private int b;

    public static void methodName()
    {
    // can i interact with the instance member at here since i have declared this method as
    // static .
    }
    }

  2. CODECALL Circuit advertisement

     
  3. #2
    Join Date
    May 2009
    Location
    Belgium
    Posts
    1,889
    Rep Power
    25

    Re: help in class

    Maybe this helps:
    class OuterClass {
    ...
    static class StaticNestedClass {
    ...
    }
    class InnerClass {
    ...
    }
    }
    A nested class is a member of its enclosing class. Non-static nested classes (inner classes) have access to other members of the enclosing class, even if they are declared private. Static nested classes do not have access to other members of the enclosing class. As a member of the OuterClass, a nested class can be declared private, public, protected, or package private. (Recall that outer classes can only be declared public or package private.)
    source: Nested Classes (The Java™ Tutorials > Learning the Java Language > Classes and Objects)

    So i think here the enclosing class, is the OuterClass.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 10-21-2011, 08:21 AM
  2. Replies: 2
    Last Post: 03-30-2011, 07:13 PM
  3. Replies: 4
    Last Post: 06-30-2010, 09:22 PM
  4. Replies: 1
    Last Post: 10-20-2009, 08:49 AM
  5. class/class pointer question
    By MerakSpielman in forum C and C++
    Replies: 2
    Last Post: 04-12-2009, 09:20 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts