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

Can java program run without jre?

1009


Why char array is favored over string for the storage of passwords?

1078


What is finalize method?

1119


How to create a thread in java?

1136


What is the difference between a vector & an array list?

1166


What are the limitations of procedural programming approach?

1052


What is class??

1241


What is a boolean structure?

1089


Explain an intermediate language?

970


What is the driver class?

1041


How do you get length in java?

1030


Name and explain the types of ways which are used to pass arguments in any function in java.

1077


What is the use of object and class classes?

1041


What is difference between classpath and path variables in java?

1195


What is a map in java?

988