A+ Computer Science Inheritance Quiz A

A+ Computer Science Inheritance Quiz A

12th Grade

10 Qs

quiz-placeholder

Similar activities

CodeHS 4.5 Writing Classes and Instance Methods

CodeHS 4.5 Writing Classes and Instance Methods

9th - 12th Grade

6 Qs

Search for Content on Methods in Java

Search for Content on Methods in Java

11th - 12th Grade

10 Qs

Java Methods

Java Methods

12th Grade

10 Qs

AP CSA Arrays

AP CSA Arrays

10th - 12th Grade

14 Qs

Exploring Computer Science

Exploring Computer Science

10th - 12th Grade

14 Qs

Traversing Arrays

Traversing Arrays

10th - 12th Grade

14 Qs

OOP in java

OOP in java

12th Grade

15 Qs

CSA 1.1.1 Why Programming? Why Java?

CSA 1.1.1 Why Programming? Why Java?

10th - 12th Grade

14 Qs

A+ Computer Science Inheritance Quiz A

A+ Computer Science Inheritance Quiz A

Assessment

Quiz

Computers

12th Grade

Hard

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?