In which way does a Primitive data type is passed ?
Answer Posted / sailendra.n.jena
primitive datatype are pass this way
class A
{
int x=7;
void disp(int z)
{
System.out.println(z);
}
}
class Test
{
public static void main(String args[])
{
int x=7;
A a=new A();
a.disp(x);
}
when u pass the primtive reference to this method only
address will transfer to the parameter which i have given
to the void disp(int z).After passing the reference
variable the other variable will pointing to that object &
collect the value of that object.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How to declare objects of a class ?
What is dynamic binding(late binding)?
What are examples of modifiers?
What is the difference between && and & in java?
What are the data types supported by java? What is autoboxing and unboxing?
What about features of local inner class?
What are keywords in programming?
List the features of java programming language.
What is jit compiler in java?
What is java in simple terms?
Where to store local variables?
What is string and example?
How will you call an Applet using Java Script Function?
Why is an interface be able to extend more than one interface but a class can’t extend more than one class?
How does enum work in java?