Results 1 to 7 of 7
  1. #1

  2. #2
    Junior Member
    Join Date
    Aug 2014
    Posts
    16
    Inner classes let you define one class within another.

    They provide a type of scoping for your classes since you can make one class a member of another class.

    Just as classes have member variables and methods, a class can also have member classes.

    class Outer {
    /class Inner { }
    }// End of class

    if you compile it,
    %javac Outer.java


    you’ll end up with two class files:
    Outer.class
    Outer$Inner.class

  3. #3
    Senior Member
    Join Date
    May 2015
    Location
    UK
    Posts
    260
    A class i.e. created inside a method is called local inner class in java.

  4. #4
    Senior Member
    Join Date
    May 2016
    Location
    Delhi
    Posts
    144
    3.11. Local Classes. A local class is declared locally within a block of Java code, rather than as a member of a class. Typically, a local class is defined within a method, but it can also be defined within a static initializer or instance initializer of a class.

  5. #5
    Senior Member
    Join Date
    Dec 2014
    Location
    Florida
    Posts
    142
    Local classes are nothing but the inner classes I.e. the class defined inside another class.

  6. #6
    Member
    Join Date
    May 2016
    Posts
    76
    created inside a method is called local inner class in java. If you want to invoke the methods of local inner class, you must instantiate this class inside the method
    public class localInner1{
    private int data=30;//instance variable
    void display(){
    class Local{
    void msg(){System.out.println(data);}
    }
    Local l=new Local();
    l.msg();
    }
    public static void main(String args[]){
    localInner1 obj=new localInner1();
    obj.display();
    }
    }
    CertifyGuide – The Ultimate Source of Certification Exam Preparation Guides

  7. #7
    Registered User
    Join Date
    May 2016
    Posts
    25
    A local class is declared locally within a block of Java code, rather than as a member of a class.
    Bierdeckeldruck - Bierglaßuntersetzer | Bierdeckel | Bierdeckel bedrucken | Bierdeckel druck

Tags for this Thread

Posting Permissions

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

  Find Web Hosting      
  Shared Web Hosting UNIX & Linux Web Hosting Windows Web Hosting Adult Web Hosting
  ASP ASP.NET Web Hosting Reseller Web Hosting VPS Web Hosting Managed Web Hosting
  Cloud Web Hosting Dedicated Server E-commerce Web Hosting Cheap Web Hosting


Premium Partners:


Visit forums.thewebhostbiz.com: to discuss the web hosting business, buy and sell websites and domain names, and discuss current web hosting tools and software.