OOP Concepts and Pillars Flashcards
What is an Access Modifier?
An access modifier defines the access type of the method
What does the ‘Public’ access modifier do?
Makes the method accessible in all classes in your application
What does the ‘Protected’ access modifier do?
Makes the method accessible within the package which it is defined and in its subclasses (including subclasses declared outside of the package)
What does the ‘Private’ access modifier do?
makes the method accessible only within the class in which it is defined
What does the default access modifier do?
the default access modifier makes the method accessible within the same class and package in which its class is defined
When is the default access modifier applied to a method?
when a method is declared or defined without specifying any modifier, the default is applied.
What is a return type?
The data type of the value returned by the method.
What is the return type of a method that does not return a value?
void
What is parameter list syntax?
A comma separated list of the input parameters are defined, preceded with their data type, within the closed parentheses().
What is a superclass?
The class from which the subclass is derived. Also known as a parent class or base class
How many interfaces can a class implement?
- More than one
- up to 65535 interfaces
An object consists of 3 things. What are they?
State, behavior, and identity
What is the state of an object?
It is represented by the attributes and properties of an object.
What is the behavior of an object represented by?
it is represented by the methods of an object. It also reflects the response of an object with other objects
What is the identity of an object?
a unique name of the object that enables one object to interact with other objects