DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

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
    > 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
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

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

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.