Lecture4 Classes and Objects
1. Object oriented programming¶
Represent the real world.
- primitives (int, double, char)
- objects(String)
- Class names are Capitalized
- 1 Class = 1 file
- Having a
mainmethod means the class can be run
2. Primitives vs References¶
- Primitive types are basic java types
- Reference types are arrays and objects
The same as python
3. Static types and methods¶
Static¶
- applies to fields and methods
- Means the field/method
- Is defined for the class declaration,
- Is not unique for each instance
Non-static methods can reference static methods, but not the other way around.