Chapter 13 Flashcards

1
Q

Abstract class

A

When you are designing classes, a superclass should contain common features that are shared by subclasses. Sometimes the superclass is so abstract that it cannot have any specific instances. These classes are called abstract classes and are declared using the abstract modifier. Abstract classes are like regular classes with data and methods, but you cannot create instances of abstract classes using the new operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

abstract method

A

A method signature without implementation. It’s implementation is provided by its subclasses. An abstract method is denoted with an abstract modifier and must be contained in an abstract class. In a non-abstract subclass extended from an abstract class, all abstract methods must be implemented, even if they are not used in the subclass.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

deep copy

A

When cloning an object, all its fields are cloned recursively.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

interface

A

An interface is treated like a special class in Java. Each interface is compiled into a separate bytecode file, just like a regular class. You cannot create an instance for an interface. The structure of a Java interface is similar to that of an abstract class in that it can have data and methods. The data, however, must be constants, and the methods can have only declarations without implementation. Single inheritance is the Java restriction wherein a class can inherit from a single superclass. This restriction is eased by the use of an interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

marker interface

A

An empty interface that is used to signify that all the classes implementing the interface share certain properties.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

shallow copy

A

When cloning an object, all its fields are copied.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

subinterface

A

An interface inherited from another interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly