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 |
what are the methods in object?
How many bytes are there?
Given: 10. interface A { void x(); } 11. class B implements A { public void x() { } public voidy() { } } 12. class C extends B { public void x() {} } And: 20. java.util.List list = new java.util.ArrayList(); 21. list.add(new B()); 22. list.add(new C()); 23. for (A a:list) { 24. a.x(); 25. a.y();; 26. } What is the result? 1 Compilation fails because of an error in line 25. 2 The code runs with no output. 3 An exception is thrown at runtime. 4 Compilation fails because of an error in line 20.
What method is used to specify a container's layout in java programming?
What are namespaces in java?
What is difference between ++ I and I ++ in java?
Is java pure object oriented or not? if yes, give the valid reason.
13 Answers Emphasis, NIIT, Syntel, Wipro,
Where is the singleton class used?
How do you sort objects in java?
Is it possible to instantiate the abstract class?
Can we override private method in java?
Explain what do you mean by functional overloading in java?