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
Does sprintf allocate memory?
How do you declare a string variable?
What are the different approaches to implement a function to generate a random number?
Explain, java is compatible with all servers but not all browsers?
What is the purpose of void?
What is the full name of java?
Which method cannot be overridden in java?
Why 1 is not a prime number?
Write a program to search a number in the given list of numbers.
Can a class be private?
Difference between ‘is-a’ and ‘has-a’ relationship in java?
What is 16 bits called?
Are arrays immutable in java?
Is space a character in java?
Why java is object oriented?