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
How strings are created in java?
Can we define constructor in inner class?
Why do we use return statement?
Can a class with private constructor be extended?
How we can skip finally block of exception even if some exception occurs in the exception block in java?
How would you use Bubble Sort to sort the number of elements?
can I implement my own start() method? : Java thread
What will be the initial value of an object reference which is defined as an instance variable?
Is java programming easy?
What is casting in java programming?
What is the meaning of variable in research?
Does importing a package imports its sub-packages as well in java?
What are peerless components in java programming?
What is type inference in java8?
Explain how to force the garbage collection in java.