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 a function easy definition?
What is an i/o filter?
How do you test a method for an exception using junit?
what happens when a thread cannot acquire a lock on an object? : Java thread
What do you understand by the term string pool?
What is constant in programming?
What is the java reflection api? Why it’s so important to have?
What is a generic data type?
Why string is a class?
Can we declare an array without size in java?
Which data type is class in java?
How to calculate the length of a singly linked list in java?
What does the @override annotation do?
what do you mean by stream pipelining in java 8? Explain
How to create a base64 decoder in java8?