DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Thread: nested classes

  1. #1
    Dennis Guest

    nested classes


    in a nested class, how do i call a method from the outer class?

  2. #2
    Paul Clapham Guest

    Re: nested classes

    If your outer class is called "outer" and the nested class declared inside
    it is called "inner", then you can get an instance of the class by

    outer.inner instance = ...

    You can then call methods of the inner class by calling methods of the
    instance. (This is according to Appendix D of "The Java Programming
    Language" by Arnold and Gosling, I haven't tried it myself.)

    Dennis <duncand@greigmiddleton.com> wrote in message
    news:38fd95cc$1@news.devx.com...
    >
    > in a nested class, how do i call a method from the outer class?




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
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links