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 e java?
Is char a method in java?
What is the format specifier?
What is difference between protected and private?
What are anonymous inner classes?
Difference difference paint() and paintcomponent()?
Why is multithreading important?
How do you do absolute value in java?
How java is similar to c?
What is the use of arrays tostring () in java?
What type of variable is error flag?
What does file separator do in java?
Can we sort arraylist in java?
Is int primitive data type?
What is a nested structure?