click below
click below
Normal Size Small Size show me how
AP CSA Inheritance
AP CSA Review - Inheritance
| Term | Definition |
|---|---|
| Superclass | Base class that has common methods and properties that other derived classes or subclasses will inherit |
| Subclass | Subclass is another term for a derived class that inherits from a base class (superclass) |
| Inheritance | Inheritance allows similar objects to share common details or traits |
| Extends | To create a derived class from a base class use the keyword 'extends' after the derived class name and then specify the base class name |
| Public | This keyword means that a method or variable will be available to all other classes |
| Private | This keyword means that a method or variable will be available only to methods within the same class |
| Constructor | Automatically called when the class is created with the 'new' keyword |
| Default Constructor | This is automatically created and called when you do not define your own constructor for a class |
| Super | This keyword within a subclass method is a reference to the superclass and can be used to access the superclass constructor, methods, and properties |
| Casting | Short for typecasting. This is a process of converting values from on variable or reference to another type. |
| Upcasting | This refers to the changing of a reference from a derived (sub) class to the base (super) class |
| Downcasting | This refers to the changing of a reference from a base (super) class to a derived (sub) class |