Filters
Question type

Study Flashcards

When one object is a specialized version of another object, there is this type of relationship between them.


A) "is a"
B) "contains a"
C) "has a"
D) "consists of"

E) B) and D)
F) All of the above

Correct Answer

verifed

verified

In a UML diagram, you show a realization relationship by connecting a class and an interface with a


A) dashed line that has an open arrowhead at one end.
B) line that has an open diamond at one end.
C) dashed line.
D) line that has an open arrowhead at one end.

E) A) and D)
F) C) and D)

Correct Answer

verifed

verified

You show inheritance in a UML diagram by connecting two classes with a line that has an open arrowhead that points to the subclass.

A) True
B) False

Correct Answer

verifed

verified

A protected member of a class may be directly accessed by


A) methods of the same class.
B) methods of a subclass.
C) methods in the same package.
D) All of the above

E) All of the above
F) B) and D)

Correct Answer

verifed

verified

When a method is declared with the ________ modifier, it cannot be overridden in a subclass.


A) final
B) super
C) void
D) public

E) B) and D)
F) B) and C)

Correct Answer

verifed

verified

When an "is a" relationship exists between objects, it means that the specialized object has all of the characteristics of the general object, plus additional characteristics that make it special.

A) True
B) False

Correct Answer

verifed

verified

When an "is a" relationship exists between objects, it means that the specialized object has


A) some of the characteristics of the general class, but not all, plus additional characteristics.
B) some of the characteristics of the general object, but not all.
C) none of the characteristics of the general object.
D) all the characteristics of the general object, plus additional characteristics that make it special.

E) B) and D)
F) A) and B)

Correct Answer

verifed

verified

A ________ member's access is somewhere between private and public.


A) package
B) final
C) protected
D) static

E) A) and B)
F) None of the above

Correct Answer

verifed

verified

You can write a super statement that calls a superclass constructor, but only in the subclass's constructor.

A) True
B) False

Correct Answer

verifed

verified

If a method in a subclass has the same signature as a method in the superclass, the subclass method ________ the superclass method.


A) inherits
B) overrides
C) overloads
D) implements

E) B) and D)
F) C) and D)

Correct Answer

verifed

verified

A class becomes abstract when you place the ________ key word in the class definition.


A) super
B) extends
C) final
D) abstract

E) B) and C)
F) A) and D)

Correct Answer

verifed

verified

Which of the following statements correctly specifies two interfaces?


A) public class ClassA implements [Interface1, Interface2]
B) public class ClassA implements (Interface1, Interface2)
C) public class ClassA implements Interface1 | Interface2
D) public class ClassA implements Interface1, Interface2

E) B) and D)
F) C) and D)

Correct Answer

verifed

verified

You can use this operator to determine whether an object is an instance of a particular class.


A) equals
B) instanceof
C) >>
D) isa

E) All of the above
F) A) and C)

Correct Answer

verifed

verified

In object-oriented programming, ________ allows you to extend the capabilities of a class by creating another class that is a specialized version of it.


A) prototyping
B) code reusability
C) inheritance
D) data hiding

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

In ________, inheritance is shown with a line that has an open arrowhead at one end that points to the superclass.


A) pseudocode
B) UML diagrams
C) CRC cards
D) hierarchy charts

E) A) and D)
F) C) and D)

Correct Answer

verifed

verified

If ClassC is derived from ClassB, which is derived from ClassA, this would be an example of


A) a chain of inheritance.
B) linear inheritance.
C) multiple interfaces.
D) cascading classes.

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

An abstract class is not instantiated itself, but serves as a superclass for other classes.

A) True
B) False

Correct Answer

verifed

verified

Which of the following statements declares Salaried as a subclass of PayType?


A) public class Salaried implements PayType
B) public class PayType derives Salaried
C) public class Salaried extends PayType
D) public class Salaried derivedFrom(Paytype)

E) All of the above
F) None of the above

Correct Answer

verifed

verified

If you do not provide an access specifier for a class member, the class member is given ________ access by default.


A) private
B) public
C) protected
D) package

E) C) and D)
F) A) and C)

Correct Answer

verifed

verified

This key word indicates that a class inherits from another class.


A) final
B) super
C) implements
D) extends

E) All of the above
F) A) and B)

Correct Answer

verifed

verified

Showing 21 - 40 of 40

Related Exams

Show Answer