OOP core ideas
- OOP - Object Oriented Programming - An approach to programming that relies on objects and their interactions
- Object - a bundle of data and code
- Encapsulation - Objects encapsulate data and code
- Class
- instance variables - not declared static
- class variables - declared static
- Methods/Behavior
- instance methods - not declared static. Invoked with reference to an object. Object reference provides the context
- class methods - declared static. Can only reference class variables. Invoked with reference to a class. Class name provides the context.
- Information hiding
- private - limits visibility to the containing class
- public - visible everywhere, including within methods defined in other classes.
- public interface vs. private implementation
- Java keywords
- static - discussed above
- this - mechanism that allows an object to refer to itself