Primitive Types
What is the primary function of a compiler in the context of Java programming?
To execute Java code directly.
To translate Java code into machine code.
To debug Java code.
To write Java code.
Which of the following describes the process of translating high-level code into machine code?
Interpretation
Compilation
Execution
Abstraction
Which of the following is a primitive data type in Java?
String
ArrayList
int
Object
Which of the following is the correct way to declare and initialize an integer variable named 'age' with a value of 25 in Java?
int age = 25;
age int = 25;
variable age = 25;
25 = int age;
What happens if you try to read an integer using Scanner.nextInt()
but the user enters text?
The program reads the text as an integer.
The program throws an InputMismatchException.
The program ignores the input and continues.
The program prints an error message and exits.
What is the result of the expression 7 + 3 * 2
in Java?
13
20
17
10
What is the result of the expression 9 / 2
in Java?
4.5
4
5
4.0

How are we doing?
Give us your feedback and let us know how we can improve
What is the result of the expression in Java?
2
2.0
2.5
3
What is the value of 'num' after the following code is executed? int num = 10; num += 5;
5
10
15
20
What is the value of 'x' after the following code is executed? int x = 7; x++;
6
7
8
9