Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Explain pass by reference and pass by value?

Answer Posted / ganesh nagalingam

***In Java, primitives and object references are passed by
value.***
The variable represents the bit information which is copied
to the parameter.

eg:primitive****
Say for primitives x=2, the value of 2 is represented in
bits and it is copied to the parameter variable.

eg:object reference***
Button b = new Button("hello");
Button c = b;
Similarly for object reference the bit value in the
reference is copied to the parameter reference. Thus both
references have the same value representing an object. The
object reference(bit representation) represents a way to
get to the object.

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why enumeration is faster than iterator?

895


What is a “stateless” protocol ?

944


What are the disadvantages of using inner classes?

1077


What is early binding and late binding in java?

1114


If system.exit (0); is written at the end of the try block, will the finally block still execute?

1046


Can list have duplicates in java?

870


What is the byte range?

987


What are the actions that can occur when a thread enters blocked state?

1014


What is array list in java?

1032


How you can force the garbage collection?

937


What is included in core java?

1007


What do you mean by global variable?

906


What is data movement?

1077


When do we use synchronized blocks and advantages of using synchronized blocks?

1178


Give us the name of the list layoutmanagers in java?

887