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


Please Help Members By Posting Answers For Below Questions

What is the base class in java from which all classes are derived?

515


Why use string handling in Java?

575


What is difference between module and function?

535


Can we use catch statement for checked exceptions?

508


What is return in java?

552






what is enumset?

578


Explain the transient field modifier?

560


Explain about version control?

585


Objects or references which of them gets garbage collected?

530


Can we create constructor in abstract class ?

574


Explain about OOPS concepts and fundamentals.

589


Is math an abstract class in java?

531


How many types of assembly languages are there?

518


What does provide mean construction?

550


What do you mean by Function Overloading in java?

622