100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

AP Computer Science A Unit 9 Progress Check_ MCQ _ QUESTIONS WITH CORRECT ANSWERS..pdf

Rating
-
Sold
-
Pages
20
Grade
A+
Uploaded on
27-08-2024
Written in
2024/2025

AP Computer Science A Unit 9 Progress Check_ MCQ _ QUESTIONS WITH CORRECT ANSWERS..pdf

Institution
CGFM - Certified Government Financial Manager
Module
CGFM - Certified Government Financial Manager










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CGFM - Certified Government Financial Manager
Module
CGFM - Certified Government Financial Manager

Document information

Uploaded on
August 27, 2024
Number of pages
20
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

8/27/24, 5:54 PM
_Ale
Jeremiah
AP Computer Science A Unit 9 Progress Check: MCQ
Practice questions for this set


Learn 1/7 Study with Learn




C. Object myBook is created using the one-argument Book constructor, which uses
super to set myBook's title attribute to "Adventure Story". Object yourBook is created
using super to call to the Publication no-argument constructor to set yourBook's title
attribute to "Generic".



Choose matching term




Consider the following class declarations.
public class Publication
{
private String title;

public Publication()
{
title = "Generic";
}

public Publication(String t)
{
title = t;
}
}

1
public class Book extends Publication
{
public Book()
{
AP Computer super();A
Science Unit 9 Progress Check: MCQ
}




1/20

,8/27/24, 5:54 PM


public Book(String t)
{
super(t);
}
}
The following code segment appears in a method in another class.
Book myBook = new Book("Adventure Story"); // Line 1
Book yourBook = new Book(); // Line 2
Which of the following best describes the result of executing the code segment?




Consider the following classes.
public class Bird
{
public void sing()
{
System.out.println("Cheep");
}
}

public class Duck extends Bird
{
public void sing()
{
System.out.println("Quack");
}
}

2 public class Chicken extends Bird
{
// No methods defined
}

public class Rooster extends Chicken
{
public void sing()
{
System.out.println("Cockadoodle doo");
}
}
The following statement appears in a method in another class.
someBird.sing();
Under which of the following conditions will the statement compile and run without error?
I. When someBird has been declared as type Duck
II. When someBird has been declared as type Chicken
III. When someBird has been declared as type Rooster




AP Computer Science A Unit 9 Progress Check: MCQ

2/20

, 8/27/24, 5:54 PM
Consider the following class declarations.
public class Person
{
public void laugh()
{
System.out.print("Hahaha");
}
}

public class EvilPerson extends Person
{
public void laugh()
{
3 System.out.print("Mwahahaha");
}
}

public class Henchman extends EvilPerson
{
// No methods defined
}
The following code segment appears in a method in another class.
alice.laugh();
Under which of the following conditions will the code segment print "Mwahahaha" ?
I. When alice has been declared as type Person
II. When alice has been declared as type EvilPerson
III. When alice has been declared as type Henchman




Consider the following class declarations.
public class Dog
{
private String name;

public Dog()
{
name = "NoName";
}
}

4 public class Poodle extends Dog
{
private String size;

public Poodle(String s)
{
size = s;
}
}
The following statement appears in a method in another class.
Poodle myDog = new Poodle("toy");
Which of the following best describes the result of executing the statement?



Don't know?




Terms in this set (18)
AP Computer Science A Unit 9 Progress Check: MCQ

3/20

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Denyss Teachme2-tutor
Follow You need to be logged in order to follow users or courses
Sold
24
Member since
1 year
Number of followers
3
Documents
6307
Last sold
6 days ago
Classic Writers

I am a professional writer/tutor. I help students with online class management, exams, essays, assignments and dissertations. Improve your grades by buying my study guides, notes and exams or test banks that are 100% graded

5.0

2 reviews

5
2
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions