Java support what type of parameter passing ?
Answers were Sorted based on User's Feedback
Answer / johnjot
call by value only..when objects are passing as args, then
the reference is passed in by value..
| Is This Answer Correct ? | 10 Yes | 1 No |
Answer / 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 |
Answer / devarathnam c,kotagudibanda(po
Hi... By default java supports "pass by value" in case of
primitive datatypes.
In case of objects it supports "pass by references"
| Is This Answer Correct ? | 8 Yes | 4 No |
Answer / rajkumar ksr college
It would
support const parameters like C++.
For instance:
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / eesha
Please refer to:
http://java.sun.com/docs/books/tutorial/java/javaOO/arguments.html
| Is This Answer Correct ? | 0 Yes | 1 No |
What is the difference between C++ and Java and your preferences?
What is a classloader in java?
Differentiate between a constructor and a method? Can we mark constructors final?
Is void a data type in java?
Is it possible to use string in the switch case?
What is the immediate superclass of the Dialog class?
Why packages are used?
What is the size of boolean variable?
What is the default value of an object reference declared as an instance variable?
What does java final mean?
A person says that he compiled a java class successfully without even having a main method in it? Is it possible?
What do you mean by the term transient?