Passing of parameter

primitive types: passing by value
Object : passing by reference, but by the value of reference, not by itsself.
: passing an object reference by value.”

a reference is an int variable whose value is linked to the pointer of an object. When an object is created with new , it is assigned an area in heap, which is represented by the first positon - pointer - of the area. Then the pointer is linked to the object reference. All this means that an object can be linked to many references , but a reference would link to nothing. For example:
Object
o1=null /* which means a reference of Object is defined and name o1, it has value which is not necessarily known by programmer, and o1 is linked to nothing*/
, o2=null
, o3=null
;//end object
o1 =new Object;// an object of Object is created , whose pointer is not necessarily known by programmer, but is linked to the reference 01. */
o2=o1;

Thinking Java Content

Over view
passing-of-parameter


Content


Ref: http://www.faqs.org/docs/think_java/TIJ3_c.htm

Think Java

What you’ll see are the definitions of the objects that represent concepts in your problem space (rather than the issues of the computer representation) and messages sent to those objects to represent the activities in that space. One of the delights of object-oriented programming is that, with a well-designed program, it’s easy to understand the code by reading it. Usually, there’s a lot less code as well, because many of your problems will be solved by reusing existing library code.

At this point, it can look like a program is just a bunch of objects with methods that take other objects as arguments and send messages to those other objects.