Identifiers:
-
Names used to label classes, methods, variables, etc…
-
Can contain letters, digits, _, $
-
Can’t start with a digit
-
Can’t used reserved words
Basics of OOP:
-
Objects are used to create code that can be reused multiple times
-
Objects contain two things:
-
Attributes → Collectively represent object state
- Ex. Color, Speed, Attack, Strength
-
Actions → Make up objects behavior
- Ex. Driving, Attacking, Braking, Running
-
-
Objects can represent physical objects or concepts
-
Objects are created using classes
-
Attributes == Variables
-
Actions == Methods
-
-
Benefits:
-
Break down problems into smaller objects
-
Reuse/Recall the same code without rewriting
- Less code written
-
Makes code modular
-
Reduces complexity
-
Easier to maintain
-
Makes code cleaner
-
-