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
What are keywords in java?
What are the fileinputstream and fileoutputstream?
What is ‘is-a ‘ relationship in java?
What is a instance variable?
What is difference between hashset and hashmap?
What is the difference between sleep and wait in java?
What does \ mean in regex?
What is sorting in java?
how to open and edit XML file in Weblogic???
What is use of arraylist in java?
What is the difference between JVM and JRE?
What is the use of jtable?
Do we have pointers in java?
What are different types of constants?
List types of storage classes in java?