
Java Module 2 Quiz
Authored by Mr. V
Computers
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
14 questions
APS-222-1
Quiz
•
University
15 questions
Ch.15 Vocabulary
Quiz
•
9th Grade - University
10 questions
Google Docs Basics
Quiz
•
7th Grade - University
10 questions
Overview of Java Web Development
Quiz
•
University
10 questions
Python Quiz Techno India
Quiz
•
University
14 questions
Programación Orientada a Objetos: Conceptos básicos
Quiz
•
University
15 questions
Administration Database
Quiz
•
University - Professi...
10 questions
CSS (Text-Font-Box)
Quiz
•
1st Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade