Core Java Interview Questions-Wrapper Classes

This Core Java Interview Questions-Wrapper Classes page provides interview questions on wrapper classes in java including the definition of the wrapper class, need to wrapper classes, data conversions, string conversions, object conversions, primitive data conversions such as Boxing, Un boxing, auto boxing, auto un boxing.


Is Java fully Object Oriented Programming lang?
No java is not fully Object oriented.


Why is java called partial OOPL?
Supporting primitive data types
Not supporting all the OOP concepts.


What is Boxing in java?
Conversion primitive data into Object type is called Boxing.


What is Un boxing?
Conversion of Object data into primitive data.


What is Auto-Boxing in java?
Implicit Conversion primitive data into Object type data.
Auto boxing since jdk 1.5.


How to convert byte to Byte?
Using static method of Byte class as follows
byte b = 100 ;
Byte obj = Byte.valueOf(b);


How to create Byte object ?
We can instantiate Byte object using Byte class constructor.
byte b = 100 ;
Byte obj = new Byte(b);


What is the use of parseXxx() methods in Java?
Parsing means Conversion of data.
parseXxx() methods available in Wrapper classes used to converts String into corresponding primitive types.


Why parseXxx() methods throws Exception ?
Invalid Data conversions raises Runtime Errors.
RuntimeError is called Exception in Java.


What is ‘System.in’ describes in Java?
“in” is the pre-defined object reference variable of java.io.InputStream type.
“in” is available in System class as static variable.
“in” represents pre-defined keyboard object.


What is ‘System.out’ describes ?
“out” is the static variable available in System class.
“out” is object reference variable of java.io.PrintStream class type.
“out” represents Standard output Stream(monitor).


>Core Java Interview Questions-Command Line Arguments<

Share this