Java support what type of parameter passing ?

Answer Posted / chandrarekha

all the primitive or the simple datatypes(int,float,boolean
etc) are passed as call by value whereas the abstract
datatypes(class objects) are by call by reference.....
for example...
class classA
{
String name;
}
class classB
{
classA a=new classA();
a.name="java";
call(a);//a is an object of classA
void call(classA x)
{
x.name="JAVA";
}
public static void main()
{
......

this is call by reference...

Is This Answer Correct ?    10 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the tradeoff between using an unordered array versus an ordered array?

909


How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?

752


Define "Access specifiers" in java.

916


What is var keyword ?

915


What is java command?

778


What are loops in java?

780


What are 4 pillers of object orinted programming?

770


Can a boolean be null java?

732


Is zero a positive integer?

761


Why to use nested classes in java? (Or) what is the purpose of nested class in java?

730


Under what conditions is an object’s finalize() method invoked by the garbage collector?

776


Why is singleton class used?

765


how would you implement a thread pool? : Java thread

676


What is the purpose of void?

735


What the difference is between execute, execute Query, execute Update?

568