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
When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?
Explain static nested classes ?
What are the advantages of defining packages in java?
What is the synonym of string?
What is a literal coding?
Name four container classes.
Will the jvm load the package twice at runtime?
What is an example of a conditional statement?
Explain the concept of proper inheritance?
Explain the private protected method modifier?
explain what is transient variable in java?
What about method local inner classes or local inner classes in java?
Which one of the following suits the description of a string better: derived or primitive?
What is the difference between state-based unit testing and interaction-based unit testing?
What if I write static public void instead of public static void in java?