Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Which of the following is NOT true about abstract classes? Abstract classes are usually the parent in an inheritance hierarchy. You can instantiate an abstract

  1. Which of the following is NOT true about abstract classes?

    Abstract classes are usually the parent in an inheritance hierarchy.

    You can instantiate an abstract class using the new keyword. (Instantiate = make an object from)

    The term abstract is used in front of the class name to make the class abstract.

    Abstract classes may have zero or more abstract methods.

QUESTION 2

  1. Which of the following lines of code is the correct way to set up an abstract method in an abstract class?

    public abstract double getArea();

    public double getArea;

    public double getArea(){

    };

    public abstract double getArea(){

    return double;

    }

QUESTION 3

  1. An abstract method in an abstract class MUST be defined in any concrete subclass that inherits from the abstract class.

    True

    False

QUESTION 4

  1. How is an abstract item marked in UML?

    Abstract items should be in all CAPS in UML.

    Abstract items should be bold in UML.

    Abstract items should be underlined in UML.

    Abstract items should be italicized in UML.

QUESTION 5

  1. Which keyword is used when you want to use an interface in your class?

    implements

    extends

    uses

    inherits

QUESTION 6

  1. Why might you choose to utilize the Comparable interface?

    So that you can later use Collections.sort() to put the items in your Array/ArrayList in a specific order.

    So you can compare the code in one class to the code in another class.

    So you can put all of your classes in order.

    So you can compare apples and oranges.

QUESTION 7

  1. Interfaces never have instance fields.

    True

    False

QUESTION 8

  1. A class can only utilize one interface.

    True

    False

QUESTION 9

  1. In which of the following scenarios would it be best to make the class abstract?

    A stand-alone class that will never have child classes inheriting from it.

    A child class in an inheritance hierarchy that should remain concrete.

    A class that will provide functionality for several unrelated classes.

    A parent class in an inheritance hierarchy that should never be instantiated.

QUESTION 10

  1. Which TWO of the four principles of object-oriented programming are more focused on the idea of hiding data or unnecessary information from others who may use your classes?

    Inheritance

    Polymorphism

    Encapsulation

    Abstraction

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2005 For Windows Mobile Web Office And Database Applications Comprehensive

Authors: Gary B. Shelly, Thomas J. Cashman, Corinne Hoisington

1st Edition

0619254823, 978-0619254827

More Books

Students also viewed these Databases questions

Question

How will the reader feel upon reading this?

Answered: 1 week ago