
OOPS Quiz 2

Quiz
•
Computers
•
University
•
Hard
Gnana Pragadeesh
Used 1+ times
FREE Resource
29 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following program?
class Test {
public
static void main(String[] args)
{
int x = 10;
if (++x < 10 && (x / 0 > 10)) {
System.out.println("Bishal");
} else {
System.out.println("HI");
}
}
}
1.Compile time error
2. RuntimeException:ArithmeticException: / by zero
3. Bishal
4. HI
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these are selection statements test only for equality in Java?
a)If
b)switch
c)if & switch
d)None of the mentioned
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these are selection statements in Java?
a)if()
b)for()
c)continue
d)break
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these jump statements can skip processing remaining code in its body for a particular iteration?
a)break
b)return
c)exit
d)continue
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
__________ statement provides an easy way to dispatch execution to different parts of your code based on the value of an expression.
if-else
switch
if
while
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many times will the following code print "Welcome to Java"?
int count = 0;
while(count<10){
System.out.println("Welcome to Java");
count++;
}
8
9
10
0
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
int x= 0;
while(x<4){
x=x+1;
}
System.out.println("x is"+x);
0
1
3
4
Create a free account and access millions of resources
Similar Resources on Wayground
25 questions
Types of Programming Languages - Quiz2

Quiz
•
University
30 questions
Intro to OOP

Quiz
•
University
26 questions
Pemrograman Berorientasi Objek

Quiz
•
University
26 questions
Finals Quiz 1

Quiz
•
University
26 questions
5th Java

Quiz
•
University
25 questions
Java MCQ Quiz - TCA - 1st Intern

Quiz
•
University
34 questions
ASP Quiz

Quiz
•
University
25 questions
Feb 20, 2025 AP CompSci - 1st Period

Quiz
•
12th Grade - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University