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
What is the tradeoff between using an unordered array versus an ordered array?
How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?
Define "Access specifiers" in java.
What is var keyword ?
What is java command?
What are loops in java?
What are 4 pillers of object orinted programming?
Can a boolean be null java?
Is zero a positive integer?
Why to use nested classes in java? (Or) what is the purpose of nested class in java?
Under what conditions is an object’s finalize() method invoked by the garbage collector?
Why is singleton class used?
how would you implement a thread pool? : Java thread
What is the purpose of void?
What the difference is between execute, execute Query, execute Update?