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


Please Help Members By Posting Answers For Below Questions

What are keywords in java?

569


What are the fileinputstream and fileoutputstream?

561


What is ‘is-a ‘ relationship in java?

580


What is a instance variable?

575


What is difference between hashset and hashmap?

549






What is the difference between sleep and wait in java?

505


What does \ mean in regex?

613


What is sorting in java?

521


how to open and edit XML file in Weblogic???

1537


What is use of arraylist in java?

574


What is the difference between JVM and JRE?

614


What is the use of jtable?

639


Do we have pointers in java?

522


What are different types of constants?

508


List types of storage classes in java?

611