Thomas wrote:
> An inner class holds a reference to the object of the enclosing class.
> A nested class doesn't hold a reference to the enclosure.
>
> sample:
>
> class Enclosing{
>       int a;
>       class Inner{
>               int b = a; // ok, it's an inner class
>       }
>       static class Nested{
>               int c = a;  // this will produce a compiler error
>       }
> }
>
> As a consequence a nested class requires less memory and speeds up the
> garbage collection due to fewer cross references between various objects.
>
> further reading:
> http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#262890
>

OK, very good.
So by declaring an inner class 'static' they exist like standalone normal
classes, with no reference to the outer class, but lexically scoped within
the outer class.


Thanks,
Miguel



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Jmol-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to