[4802] in java-interest

home help back first fref pref prev next nref lref last post

Questions about LayoutManager, Garbage collection, etc...

daemon@ATHENA.MIT.EDU (ben.lam)
Mon Jan 15 17:10:28 1996

To: java-interest <java-interest@java.Eng.Sun.COM>
From: "ben.lam" <ben.lam@ac.com>
Date: 15 Jan 96 22:58:14 

(1)   In LayoutManger, the two methods:
         addLayoutComponent()   and  removeLayoutComponent()

How do they suppose to behave differently different from  add() and remove() in 
class Component?  Under what circumstances would the two layoutmanger's methods 
be called?

(2)   The garbage collection method System.gc().  If I call it explicitly, does 
it mean the grabage collection process is going to start immediately?

I thought I read somewhere that even if you call it, it doesn't guarantee that 
it is going to start collecting immediately.  I may be hallucinating at that 
time.  Please tell me if I'm wrong.

(3)    A potentially stupid question about "import"

If say I have "import" statements in my code, e.g.     import java.util.*

And in my code, actually none of the classes in java.util.* are referenced or 
used.  After compilation, the size of my program would be the same as the code 
that don't have the "import java.util.*" statement?

(4)   My understanding is  classes can be defined using the following syntax:

                (i)    public class Name1 {
                        }

              (ii)    private class Name2 {
                       }

             (iii)    protected class Name3 {
                       }

               (iv)  class Name4 {
                       }

Correct me if that's not true.
But the important thing is what's the difference between (i) and (iv)?

Thanks for any input.

---Ben Lam

-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post