
A+ Computer Science Inheritance Quiz A
Authored by Logan Scherpenberg
Computers
12th Grade

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
15 mins • 1 pt
Which reserved word is used to indicate that one class is a child or descendant of another class?
super
extends
implements
derives
child
2.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
Consider the classes and client code below to determine what is printed by the client code. public class N { private int one; public N() { one=5; } public String toString() { return ""+ one; } } public class O extends N { } //client code N it = new O(); System.out.println( it );
null
0
5
O
N
3.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
Consider the classes and client code below to determine the output of the client code. public class N { private int one; public N( int x ){ one=x; } public String toString(){ return ""+ one; } } public class O extends N { public O( int x ){ super( x ); } } //client code N it = new O(7); System.out.println( it ); a. null b. 0 c. 5 d. 3 e. 7 Answer: e. 7
null
0
5
3
7
4.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
Consider the classes below and determine what is printed out by the client code. public class V { public void one(){ System.out.print("it"); } public void two(){ System.out.print("go"); } } public class W extends V { public void one(){ System.out.print("up"); } public void two(){ System.out.print("at"); } public void testIt(){ one(); super.two(); } } /////////////////////////////////////////// //client code in the main of another class V x = new V(); x.one();
it
at
go
up
null
5.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
Consider the classes below and determine what is printed out by the client code. public class V { public void one(){ System.out.print("it"); } public void two(){ System.out.print("go"); } } public class W extends V { public void one(){ System.out.print("up"); } public void two(){ System.out.print("at"); } public void testIt(){ one(); super.two(); } } /////////////////////////////////////////////// //client code in the main of another class V x = new W(); x.one();
it
at
go
up
null
6.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
Consider the classes below and determine what is printed out by the client code. public class V { public void one(){ System.out.print("it"); } public void two(){ System.out.print("go"); } } public class W extends V { public void one(){ System.out.print("up"); } public void two(){ System.out.print("at"); } public void testIt(){ one(); super.two(); } } /////////////////////////////////////////// //client code in the main of another class V x = new W(); x.one(); x.two(); a. itgo b. upat c. itat d. upgo e. null Answer: c. itat
a. itgo
b. upat
c. itat
d. upgo
e. null
7.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
Consider the classes below and determine what is printed out by the client code. public class V { public void one(){ System.out.print("it"); } public void two(){ System.out.print("go"); } } public class W extends V { public void one(){ System.out.print("up"); } public void two(){ System.out.print("at"); } public void testIt(){ one(); super.two(); } } /////////////////////////////////////////////// //client code in the main of another class V x = new W(); x.one(); x = new V(); x.two(); a. itgo b. upat c. itat d. upgo e. null Answer: a. itgo
a. itgo
b. upat
c. itat
d. upgo
e. null
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
15 questions
Grade 12-Python selection&iteration
Quiz
•
11th - 12th Grade
14 questions
ULANGAN HARIAN VPN SERVER
Quiz
•
12th Grade
9 questions
Java Basics #1
Quiz
•
10th - 12th Grade
13 questions
Python Fundamentals and Programming
Quiz
•
11th - 12th Grade
10 questions
Bitmap/Adobe Photoshop
Quiz
•
9th - 12th Grade
15 questions
The World Wide Web
Quiz
•
7th - 12th Grade
10 questions
CodeTigers Python 101
Quiz
•
KG - Professional Dev...
15 questions
Python Basics
Quiz
•
KG - University
Popular Resources on Wayground
8 questions
Spartan Way - Classroom Responsible
Quiz
•
9th - 12th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
14 questions
Boundaries & Healthy Relationships
Lesson
•
6th - 8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
3 questions
Integrity and Your Health
Lesson
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
9 questions
FOREST Perception
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade