In which way does a Primitive data type is passed ?
Answers were Sorted based on User's Feedback
Answer / sandeep
Primitive data type are passed using wrapper classes. This
class provide us an object view of primitive types.
e.x.
Integer i=new Integer(3);
| Is This Answer Correct ? | 6 Yes | 1 No |
Answer / subha narayan mohapatra
all Primitive data types are passed by value.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / 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 |
when to use ArrayList and when to use HashMap in webApplication.
How can we find the sum of two linked lists using stack in java?
What are the object and class classes used for?
What is the range of the char type?
Can we use a default constructor of a class even if an explicit constructor is defined?
what is the use of declaring constructor as private?
5 Answers Cyient, IVY Technologies, Sai Softech, Virtusa,
What is the difference between jsp and servlet?
Define linked list and its features with signature?
What is the use of flag?
What is integers and example?
Is there a case when finally will not execute?
Should a main method be compulsorily declared in all java classes?