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
hr interview how many minutes asking question
What is purpose of keyword void?
What is anagram word?
What do you mean by byte code?
How do I convert a string to an int in java?
What are three advantages of using functions?
Explain the usage of this with constructors?
What is the full form of jpeg?
Which programming language is best in future?
Can java list contain duplicates?
What is exception hierarchy in java?
How many tetrahedral voids are there in bcc?
Which access specifier can be used with class ?
What is compareto () in java?
How do you check if a character in a string is a digit or letter?