Instantiating an object is like making it come alive. Think of it as the difference between a recipe and a cooked dish. The compiled byte code is like the recipe of a dish. You can read it, you know what goes in it, you may know how you are supposed eat it, but you cant' do anything else with it. When the dish is ready is when you can actually see it, eat it ,smell it etc. Hope this helps

Krystal Tyler
Greenhorn

Joined: Feb 03, 2002
Posts: 4

posted Feb 04, 2002 20:32:00

0

So therefore the object instantiated in class B which is of class A has access to all methods from the first class including the private ones? It must have access as well to all the member variables? Thanks.

Shivaji Marathe
Ranch Hand

Joined: Jan 11, 2002
Posts: 203

posted Feb 05, 2002 06:27:00

0

Krystal : You can actually write small programs yourself to test this out. Create a test class with private, protected,public and default access methods. Then create another class and in the main method of that class create an instance of the first class and call all the methods of the first class. Are you able to compile and run the second class?