1/25
Flashcards from lecture notes on Object-Oriented Programming in Java.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Class
A structure that defines the data and the methods to work on that data and serves as a blueprint for an object.
Object
An executable copy of a class, with its own properties and methods.
Public Access Modifier
Allows the class to be accessed by any other class.
Private Access Modifier
Doesn't allow the class to be accessed by any other class.
Default Access Modifier
Used when no access modifier is specified, also called package-private.
Private Property and Method Access Modifier
Only accessible within the class they are declared in
Protected Property and Method Access Modifier
Accessible by subclasses within any package.
Public Property and Method Access Modifier
Accessible from everywhere in the program.
Default Property and Method Access Modifier
Accessible only within the same package (package-private)
Encapsulation
Objects are the most important units in an OOP system and must maintain their integrity.
Constructors
Special methods that are only called during instantiation to assign values upon creation.
Association
Describes a “using” relationship Objects in this relationship maintain their own life cycle, the destruction of one does not cause the destruction of another
Association – Directed
A one-way association where Only instances of one class use instances of the other class Classes whose instances share a directed association relationship with another object would often have a method that accepts instances of the other class as its parameter
Association – Bidirectional
A two-way association where Instances of both classes can perform the associative action to each other
Association – Reflexive
Exists between separate instances of the same class OR to the same instance of a class itself.
Aggregation
A special, more specific kind of Association Describing a part-whole relationship Where the objects still have their own life cycles
Composition
A special, more specific kind of Aggregation Where, like aggregation, the classes in this relationship exhibit a part-whole relationship (specifically “part-of”) However, one class is dependent on the existence of the other class
Unified Modeling Language
Is used to represent a system / entities Aids in object-oriented design process as a tool for visual representation
Multiplicity
Defines the count of objects that are expected to participate in a relationships
Array
Is fixed in terms of size
ArrayList
Is a dynamic array (no need to specify the size) that extends the List interface
Programming Paradigm
A fundamental style of programming answering the question… “How do I think about and solve a problem?”
Java
Is an object-oriented language , both a compiled and interpreted language
Static Keyword
Associates the assigned entity to the class, not an instance Static variable or method can be used by directly referencing the class
Final Keyword
Variables must have a value Methods cannot be overridden Classes cannot be extended
Overloading
Having multiple methods or constructors with the same name but with different signatures