Core Java Technical Test – Data types

Core Java Technical Test: This Core Java Technical Test on DataTypes 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 Data types.


1. What is the Output of following Code?
class Test
{
p.s.v. main(String[] args)
{
int x=5 , y=2 ;
float z = x/(float)y ;
S.o.p(“z value : “+z);
}
}

 
 
 
 

2. What is the Output of following Code?
class Test
{
public static void main(String[] args)
{
byte a=10 , b=30 , c;
c = a+b ;
System.out.println(c);
}
}

 
 
 
 

3. What is the Output of following Code?
class Test
{
public static void main(String[] args)
{
byte b = 65 ;
char ch = b ;
System.out.println(ch);
}
}

 
 
 
 

4. What is the Output of following Code?
class Test
{
public static void main(String[] args)
{
System.out.println((int)D);
}
}

 
 
 
 

5. What is the Output of following Code?
class Test
{
public static void main(String[] args)
{
byte j = (byte)612 ;
System.out.println((char)j);
}
}

 
 
 
 

6. What is the Output of following Code?
class Test
{
public static void main(String[] args)
{
int i = -131 ;
byte b = (byte)i ;
System.out.println(“b value : “+b);
}
}

 
 
 
 

7. What is the Output of following Code?
class Test
{
p.s.v. main(String[] args)
{
int x=5 , y=2 ;
float z = x/y ;
S.o.p(“z value : “+z);
}
}

 
 
 
 

8. What is the Output of following Code?
class Test
{
public static void main(String[] args)
{
byte a=100 , b=30 ;
System.out.println((byte)(a+b));
}
}

 
 
 
 

9. What is the Output of following Code?
class Test
{
public static void main(String args[ ])
{
int a ;
System.out.println(“a value : “+a);
}
}

 
 
 
 

10. What is the Output of following Code?
class Test
{
public static void main(String[] args)
{
int i = -32774 ;
short s = (short)i ;
System.out.println(s);
}
}

 
 
 
 

Question 1 of 10

Share this