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 ? | 9 Yes | 2 No |
Post New Answer View All Answers
Explain the importance of throws keyword in java?
Write a function for palindrome and factorial and explain?
What is the difference between a constructor and a method?
Can we create object of inner class in java?
What is java lang object?
What is the right data type to represent a price in java?
What is singletonlist in java?
How many types of interfaces are there?
When to use runnable interface vs thread class in java?
How to perform bubble sort in java?
Is constructor inherited?
What is the char data type?
What are the types of relation?
What is command line argument
What are the types of collections in java?