
OOAD Quiz 4

Quiz
•
Education
•
University
•
Medium
Dr. Pal
Used 1+ times
FREE Resource
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
public class DataTypeQuiz {
public static void main(String[] args) {
int x = 5;
int y = 10;
int result = (x++ y--) - (--x ++y);
System.out.println(result);
}
}
0
25
30
20
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the default value of a 'char' variable in Java?
'0'
'\u0000'
' ' (space)
'null'
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
public class ArrayQuiz {
public static void main(String[] args) {
int[] numbers = new int[5];
System.out.println(numbers[2]);
}
}
0
2
garbage value
null
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is NOT a valid Java array declaration?
int[] numbers = new int[5];
int[] numbers = {1, 2, 3, 4, 5};
int numbers[] = new int[5];
int numbers[5];
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
public class OperatorQuiz {
public static void main(String[] args) {
int x = 5;
int y = 10;
int z = x++ + ++y;
System.out.println("z = " + z);
System.out.println("x = " + x);
System.out.println("y = " + y);
}
}
z = 16, x = 6, y = 11
z = 15, x = 5, y = 11
z = 16, x = 6, y = 10
z = 15, x = 6, y = 10
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
public class ControlFlowQuiz {
public static void main(String[] args) {
int x = 5;
int y = 10;
if (x != 5 && y > 5) {
System.out.println("Condition is true");
} else {
System.out.println("Condition is false");
}
}
}
Condition is true
Condition is false
Compilation error
Runtime error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
public class OperatorQuiz {
public static void main(String[] args) {
int x = 5;
int y = 10;
int result = x * y / (x + y);
System.out.println("Result: " + result);
}
}
Result: 2
Result: 3
Result: 0
Result: 1
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
ZZG2024

Quiz
•
University
7 questions
FPW - SEM III - PROGRAMAR USANDO JAVASCRIPT

Quiz
•
University
12 questions
Introduction to Companies Act

Quiz
•
University
15 questions
Strategic Communication Quiz

Quiz
•
University
12 questions
Ekonomi Mikro dan Demand Terhadap Pelayanan Kesehatan

Quiz
•
University
10 questions
introducción a al programación

Quiz
•
University
10 questions
RELACIONES INTERNACIONALE 1 Y 2

Quiz
•
University
11 questions
Career Talk

Quiz
•
University
Popular Resources on Wayground
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
20 questions
ELA Advisory Review

Quiz
•
7th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns

Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Education
11 questions
NFL Football logos

Quiz
•
KG - Professional Dev...
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
38 questions
Unit 6 Key Terms

Quiz
•
11th Grade - University
20 questions
La Hora

Quiz
•
9th Grade - University
7 questions
Cell Transport

Interactive video
•
11th Grade - University
7 questions
What Is Narrative Writing?

Interactive video
•
4th Grade - University