Answer Posted / jitu
In case of autoboxing directly the value of the constructor
assign to a variable.i.e object of wrapper class directly
assign to a variable.but it is only possible in case of 1.5
version.
Ex:public class X
{public static void main(String a[])
{Integer i1=new Integer("20");
Integer i2=new Integer("20");
int m1=i1;
int m2=i2;
S.o.p(m1+m2);o/p-20
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is the difference between the file and randomaccessfile classes?
Can we have any code between try and catch blocks?
How to create an immutable class?
What is the Concept of Encapsulation in OOPS
Explain the scope or life time of class variables or static variables?
Explain the use of javap tool.
Can we override the static methods?
What are the types of java languages?
How infinite loop is declared?
What are use cases?
What does a method signature consist of?
Are the imports checked for validity at compile time? Will the code containing an import such as java.lang.abcd compile?
What does the ‘static’ keyword mean? Is it possible to override private or static method in java?
What are the four corner stones of oop?
What is the difference between the font and fontmetrics classes in java programming?