nested classes


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: nested classes

Hybrid View

  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?




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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center