
A+ Computer Science Inheritance Quiz A

Quiz
•
Computers
•
12th Grade
•
Hard
Logan Scherpenberg
FREE Resource
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
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
OOP in java(2)

Quiz
•
12th Grade
13 questions
Week 8

Quiz
•
12th Grade
9 questions
quis lat soal

Quiz
•
9th - 12th Grade
15 questions
Quizizz vpn

Quiz
•
12th Grade
15 questions
Topic 3 & 4 Practice - ArrayList and String Methods

Quiz
•
12th Grade
9 questions
2.2(a) Network Architecture

Quiz
•
12th Grade
11 questions
Adobe Illustrator Quiz #1

Quiz
•
9th - 12th Grade
10 questions
QUIZ TIK - KELAS 12

Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade