+ Reply to Thread
Results 1 to 2 of 2

Thread: help in class

  1. #1
    Programmer R3.RyozKidz is an unknown quantity at this point R3.RyozKidz's Avatar
    Join Date
    Oct 2009
    Posts
    120

    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. #2
    Programming Expert oxano is on a distinguished road oxano's Avatar
    Join Date
    May 2009
    Location
    Belgium
    Age
    20
    Posts
    456

    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.

+ Reply to 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: 11-02-2009, 06:30 AM
  2. Tutorial: Starting C# with C# 2008 Express Edition
    By Jordan in forum CSharp Tutorials
    Replies: 20
    Last Post: 07-27-2009, 01:45 AM
  3. Classes in VB.NET
    By Vswe in forum VB Tutorials
    Replies: 1
    Last Post: 07-21-2009, 09:18 AM
  4. PHP Objects
    By chili5 in forum PHP Tutorials
    Replies: 5
    Last Post: 03-24-2009, 02:12 PM
  5. PHP 5 and OOP
    By Jordan in forum PHP Tutorials
    Replies: 11
    Last Post: 09-21-2008, 10:58 PM