Values and Data types I

Values and Data types I

Primitive Data Types, Type Conversion and Casting, Wrapper Classes, String Data Type

1 / 10

Which of the following statements about primitive data types is correct?

2 / 10

Which of the following correctly demonstrates the range of the int data type in Java?

3 / 10

What will happen when the following code is executed?

byte b = 127;

b = (byte)(b + 1);

System.out.println(b);

4 / 10

What will the following code output?

int a = 10;
double b = 20.5;
double result = a + b;
System.out.println(result);

5 / 10

Which of the following is true about typecasting in Java?

6 / 10

What will the following code produce?

double x = 99.99;
int y = (int)x;
System.out.println(y);

7 / 10

Which of the following is NOT true about wrapper classes in Java?

8 / 10

What will the following code output?

Integer x = 10;
Integer y = 10;
System.out.println(x == y);

9 / 10

What is the output of the following code?

String s1 = “Java”;
String s2 = new String(“Java”);
System.out.println(s1 == s2);

10 / 10

Which of the following statements about strings is true?

Your score is

Scroll to Top