Java Operators Conditionals Loops Assignments
Java Operators Conditionals Loops Assignments
int a = 5;
System.out.println(a++ + ++a);
A. 10 B. 11 C. 12 D. 13
A. = B. == C. := D. equals
A. & B. && C. | D. %=
A. 1 B. 3 C. 0 D. 10
A. || B. | C. ^ D. &&
A. To compile faster B. To make the program shorter C. To explain code and ignore during execution D. To
int i = 0;
Java Fundamentals - MCQs and Assignments
do {
i++;
A. 1 2 3 B. 0 1 2 C. 1 2 D. 0 1
A. 4 B. 5 C. 6 D. Infinite
A. a == b B. a != b C. a = b D. a >= b
A. End the program B. Handle unmatched cases C. Initialize variable D. Reset loop
A. They are invalid in Java B. They can only be two levels deep C. One if can be placed inside another D.
A. Child c = Parent; B. Parent p = (Parent) new Child(); C. Child c = (Child) parentObj; D. Child c = new
Parent();
2 Assignment Questions
1. Write a Java program that takes a number as input and checks if it is even or odd using if-else condition.
2. Create a Java program using a for loop that prints the multiplication table of a given number.