This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
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
Joined: Feb 03, 2002
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.
Joined: Jan 11, 2002
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?