
Java Module 2 Quiz

Quiz
•
Computers
•
University
•
Hard
Mr. V
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
hi hi
hi world
world world
Compilation fails.
An exception is thrown at runtime.
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
4
3
2
1
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
D
B
A
C,F
E
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Given:
11. abstract class Vehicle { public int speed() { return 0; }
12. class Car extends Vehicle { public int speed() { return 60; }
13. class RaceCar extends Car { public int speed() { return 150; }
...
21. RaceCar racer = new RaceCar();
22. Car car = new RaceCar();
23. Vehicle vehicle = new RaceCar();
24. System.out.println(racer.speed() + ", " + car.speed()
25. + ", " + vehicle.speed());
What is the result?
0,0,0
150,60,0
150,150,150
60,0,150
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Given:
5. class Building { }
6. public class Barn extends Building {
7. public static void main(String[] args) {
8. Building build1 = new Building();
9. Barn barn1 = new Barn();
10. Barn barn2 = (Barn) build1;
11. Object obj1 = (Object) build1;
12. String str1 = (String) build1;
13. Building build2 = (Building) barn1;
14. }
15. }
Which is true?
If line 10 is removed, the compilation succeeds.
If line 13 is removed, the compilation succeeds.
If line 11 is removed, the compilation succeeds.
More than one line must be removed for compilation to succeed.
If line 12 is removed, the compilation succeeds.
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Given:
21. class Money {
22. private String country = "Canada";
23. public String getC() { return country; }
24. }
25. class Yen extends Money {
26. public String getC() { return super.country; }
27. }
28. public class Euro extends Money {
29. public String getC(int x) { return super.getC(); }
30. public static void main(String[] args) {
31. System.out.print(new Yen().getC() + " " + new Euro().getC());
32. }
33. }
What is the result?
null Canada
Compilation fails due to an error on line 26.
Canada null
Canada Canada
Compilation fails due to an error on line 29.
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the maximum number of levels possible in a Multilevel Inheritance in Java?
32
16
8
no limit
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
JAVA FOR ANDROID-JAVA

Quiz
•
University
8 questions
Operating System - Chapter 4

Quiz
•
University
13 questions
Quiz1_PBO_B_C

Quiz
•
University
10 questions
OSI Model - Network Layer

Quiz
•
9th Grade - Professio...
15 questions
Wipro PRP - 7th June 2023

Quiz
•
University
15 questions
II CSM A & B

Quiz
•
University
13 questions
CSE_A1_QUIZ 6(15-05-23)

Quiz
•
University
10 questions
Java Arrays

Quiz
•
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