Prepare for the 241 Computer Science Certification Exam with comprehensive flashcards and multiple choice questions. Enhance knowledge with explanations and hints to excel in your test journey!

Multiple Choice

Which term best describes a class that inherits characteristics from another class?

Inheritance in object-oriented programming lets a class derive from another, reusing its fields and methods while adding or overriding behavior. The class that does the deriving is the child class, also known as the subclass. It inherits the characteristics of the parent class and can extend or customize them, which is why you can think of it as a more specialized version. For example, if you have a general class like Animal with common actions such as eat and move, a Dog class can inherit those behaviors and also introduce dog-specific actions like bark. An interface is not a class that inherits; it defines a contract of methods that a class agrees to implement. A parent class is the one being inherited from, the source of shared features. An anonymous class is a nameless class used for immediate, often one-off, implementations.

Inheritance in object-oriented programming lets a class derive from another, reusing its fields and methods while adding or overriding behavior. The class that does the deriving is the child class, also known as the subclass. It inherits the characteristics of the parent class and can extend or customize them, which is why you can think of it as a more specialized version. For example, if you have a general class like Animal with common actions such as eat and move, a Dog class can inherit those behaviors and also introduce dog-specific actions like bark.

An interface is not a class that inherits; it defines a contract of methods that a class agrees to implement. A parent class is the one being inherited from, the source of shared features. An anonymous class is a nameless class used for immediate, often one-off, implementations.