1/17
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Encapsulation
The process of making data private and accessing it through getter and setter methods.
Setter Method
A method that allows for setting a value of a property; can have multiple parameters but typically advised against.
Getter Method
A method that returns the private data it accesses.
Inheritance
The mechanism to create a new class using an existing class, denoted with the 'extends' keyword.
super
A keyword used to call the parent class constructor and methods from the child class.
Constructor Invocation
When a child class constructor explicitly calls the parent class constructor using 'super'.
Parameterized Constructor
A constructor that requires parameters to create an object; must be invoked explicitly when only parameterized constructors exist in the parent class.
Dynamic Method Calling
Achieved through method overriding and using a superclass reference variable.
Preventing Method Overriding
Use final methods or static methods to restrict changes in method implementations.
Type Casting
The conversion of a variable from one data type to another.
Upcasting
Using a superclass reference for a child class object.
Downcasting
Converting a superclass reference back to a child class reference.
Preventing Inheritance
Making a class final or using certain classes like String and Math which cannot be inherited.
Abstract Class
A class that cannot be instantiated and may contain abstract methods that need to be overridden.
Interface
A conceptual entity that acts like a class but cannot be instantiated; used to define methods that must be implemented.
Interface Members
Attributes in interfaces are public, static, and final by default; methods are abstract unless defined as default or static.
Default Method
An instance method in an interface that provides a default implementation.
Static Method
A method that belongs to the class rather than instances of the class and can be called without creating an instance.