Core Java Technical Test – Wrapper Classes

Core Java Technical Test: This Core Java Technical Test on wrapper Classes page is providing SCJP or OCJP certification level questions to test your java programming skills and helpful to clear all the technical interviews easily. This test is including the concept of Wrapper Classes in Java.


1. What is the output of following code?
class Test
{
public static void main(String[] args)
{
Boolean b = new Boolean(“Java2Python”);
System.out.println(b);
}
}

 
 
 
 

2. What is the output of following code?
class Test
{
public static void main(String[] args)
{
float f = Float.parseFloat(34.56);
System.out.println(f);
}
}

 
 
 
 

3. What is the output of following code?
class Test
{
public static void main(String[] args)
{
Integer i = 100 ;
System.out.println(i);
}
}

 
 
 
 

4. What is the output of following code?
class Test
{
public static void main(String[] args)
{
System.out.println((byte)Character.MAX_VALUE);
}
}

 
 
 
 

5. What is the output of following code?
class Test
{
public static void main(String[] args)
{
Integer obj = new Integer(“A”);
System.out.println(obj);
}
}

 
 
 
 

6. What is the output of following code?
class Test
{
public static void main(String[] args)
{
System.out.println(Double.SIZE);
}
}

 

 
 
 
 

7. What is the output of following code?
class Test
{
public static void main(String[] args)
{
System.out.println(Boolean.MIN_VALUE);
System.out.println(Boolean.SIZE);
}
}

 

 
 
 
 

8. What is the output of following code?
class Test
{
public static void main(String[] args)
{
Integer a = Integer.valueOf(“100”);
System.out.println((char)a.intValue());
}
}

 

 
 
 
 

9. What is the output of following code?
class Test
{
public static void main(String[] args)
{
Integer a = Integer.valueOf(“100”);
if(a.equals(new Integer(100)))
System.out.println(true);
else
System.out.println(false);
}
}

 
 
 
 

10. What is the output of following code?
class Test
{
public static void main(String[] args)
{
int res = Integer.valueOf(“100”).compareTo(new Integer(100));
System.out.println(res);
}
}

 
 
 
 

Question 1 of 10

Share this