Unit 9: Inheritance Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Abstraction

A

The process of simplifying complex systems by focusing on essential features while hiding unnecessary details. It allows programmers to work with high-level concepts without worrying about implementation specifics.

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

Classes

A

User-defined data types in object-oriented programming. They serve as blueprints for creating objects by defining their attributes and methods.

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

Creating Superclasses and Subclasses

A

Involves designing and implementing relationships between classes in an object-oriented program. Superclasses provide common attributes and behaviors that can be inherited by subclasses, allowing for code reuse and organization.

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

Data Structures

A

Ways to organize, store, and manipulate data efficiently. They provide different methods of accessing, inserting, deleting, or searching for data elements based on specific requirements.

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

Diamond Problem

A

Refers to an issue that arises in multiple inheritance when two superclasses share a common superclass, resulting in ambiguity for subclasses on which superclass’s method to use.

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

Instance Variables

A

Variables declared within a class but outside any method. They hold unique values for each instance (object) of the class and define the state or characteristics of an object.

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

Object-Oriented Programming

A

A programming paradigm that organizes code into objects, which are instances of classes. It focuses on creating reusable and modular code by encapsulating data and behavior together.

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

Static Typing

A

A programming language feature that requires variables to be declared with their data types before they can be used. It helps catch errors at compile-time by enforcing type compatibility.

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

Subclasses

A

Classes that inherit properties and behaviors from superclasses. They can add additional attributes or override existing ones to create specialized versions of the superclass.

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

Superclasses

A

Refer to classes that other classes inherit from. They contain common attributes and behaviors that can be shared by multiple subclasses.

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

The Object Superclass

A

The root class in Java and many other object-oriented programming languages. All classes are derived from this superclass either directly or indirectly.

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

Constructors

A

Special methods within classes that are used to initialize objects when they are created. They have the same name as the class and are called automatically when an object is instantiated.

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

Inheritance Hierarchy

A

Represents the relationship between classes where one class inherits properties and behaviors from another class. It forms a hierarchical structure with parent and child classes.

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

Method Signature

A

Refers to the unique combination of a method’s name and its parameter types. It helps distinguish one method from another.

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

super keyword

A

Used in Java to refer to the superclass of a subclass. It allows access to the superclass’s methods, constructors, and instance variables.

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

extends SuperClassName

A

This keyword is used in object-oriented programming to establish an inheritance relationship between classes. It allows a subclass to inherit properties and behaviors from a superclass.

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

Inheritance

A

A concept in object-oriented programming where a class inherits the properties and behaviors of another class. It allows for code reuse and promotes the creation of hierarchical relationships between classes.

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

Methods

A

Functions defined within a class that perform specific tasks or actions when called upon by an object. They can manipulate data, interact with other objects, or return values.

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

Polymorphism

A

Refers to the ability of objects to take on multiple forms or have multiple types. In programming, it allows different objects to be treated as instances of a common superclass, enabling flexibility and extensibility.

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

Superclass

A

Also known as a parent class or base class, is a class that is extended by another class (subclass). It provides common attributes and behaviors that can be inherited by its subclasses.

21
Q

area() method

A

A function defined within a class that calculates and returns the area of an object, such as a shape or figure.

22
Q

extends

A

In Java, this keyword is used to create a subclass that inherits properties and methods from a superclass. It establishes an “is-a” relationship between classes.

23
Q

isEquivalent() method

A

A method used to compare two objects or values to determine if they are equivalent or equal in some way. It typically returns true if they are equivalent, and false otherwise.

24
Q

Object class

A

A blueprint or template for creating objects in object-oriented programming. It defines the properties and behaviors that an object of that class will have.

25
Q

Subclass

A

A class that inherits properties and behaviors from another class, called the superclass. It can add new features or modify existing ones.

26
Q

@Override

A

Annotation used in Java to indicate that a method in a subclass is intended to override a method with the same name in its superclass. It helps ensure that the method signature and return type are correct.

27
Q

Javadoc comments

A

Special comments in Java that begin with /** and end with */. They are used to generate documentation for classes, methods, and fields, making it easier for other developers (including yourself) to understand how to use them.

28
Q

Overloading

A

Refers to defining multiple methods with the same name but different parameters within a single class. The methods must have different parameter lists or different types of parameters.

29
Q

Overriding

A

Occurs when a subclass provides its own implementation of a method that is already defined in its superclass. The overridden method in the subclass replaces the implementation inherited from the superclass.

30
Q

Public Methods

A

Functions or procedures in a class that can be accessed and called from anywhere in the program. They are accessible to all other classes and objects.

31
Q

Area method

A

A technique used in computer science to calculate the size or complexity of an algorithm by counting the number of basic operations performed. It helps determine the efficiency and performance of an algorithm.

32
Q

isEquivalent method

A

A function used in computer programming that compares two objects or values and determines if they are equal in terms of their properties or attributes. It returns true if they are equivalent and false otherwise.

33
Q

Overriding

A

A subclass provides its own implementation of a method that is already defined in its superclass. The overridden method in the subclass replaces the implementation inherited from the superclass.

34
Q

Quadrilateral Class

A

A general class in object-oriented programming that represents a four-sided polygon. It serves as the parent class for more specific types of quadrilaterals, such as rectangles, squares, and parallelograms.

35
Q

Rectangle Class

A

A specific type of shape defined in object-oriented programming that represents a four-sided polygon with opposite sides being equal in length and all angles being right angles.

36
Q

Hierarchy Tree

A

A graphical representation that illustrates the hierarchical relationship between different elements or entities. It organizes them into levels or layers based on their parent-child relationships.

37
Q

Object

A

An instance of a class that encapsulates data and behavior. It represents a real-world entity or concept in the program.

38
Q

Type Diagram

A

A visual representation that shows the relationships between different types of objects in a program. It helps programmers understand how classes and interfaces are related to each other.

39
Q

Constructor

A

A special method within a class that is used to initialize objects of that class. It is called automatically when an object is created and helps set initial values for its attributes.

40
Q

Dynamic Type

A

Refers to the actual type of an object at runtime. It may differ from its static (declared) type and is determined based on the specific instance assigned to it during program execution.

41
Q

Method Calling

A

Refers to invoking or executing a method in Java code. It involves using the method’s name followed by parentheses and passing any required arguments inside those parentheses.

42
Q

override

A

Refers to providing a different implementation for a method inherited from a superclass or interface in its subclass or implementing class respectively. It allows the subclass to customize the behavior of inherited methods.

43
Q

Static Type

A

Refers to the declared type of a variable or expression at compile-time. It determines the set of operations that can be performed on the variable or expression.

44
Q

equals()

A

Used to compare two objects for equality. It checks if the values of the objects are the same, rather than comparing their memory addresses.

45
Q

hashCode()

A

Used in Java to generate a unique integer value representing an object’s identity. It is often overridden in classes when custom equality comparisons need to be made.

46
Q

java.lang package

A

A built-in package in Java that provides fundamental classes and interfaces for the Java language. It includes classes such as String, Integer, and Math.

47
Q

Object superclass

A

The root class in Java that all other classes inherit from. It provides basic functionality and methods that are common to all objects.

48
Q

Properties

A

Characteristics or attributes of an object that define its state. They store data and can be accessed and modified by the object’s methods.

49
Q

toString()

A

Used to convert an object into a string representation. It returns a string that represents the state of the object.