Mindmap
Object-oriented Programming
Inhalt der Mindmap
Object-oriented Programming
Classes: template to create identical types of objects
- Objects: living, non-living, abstract, or concrete
- Attributes = fields
- Capitalize the initial of each word except the first one
- Actions = methods
- Capitalize the initial of each word except the first one
- returnType methodName (liistOfArguments)
- Ex: double getSalary ()
- Ex: int add (int a, int b)
- Ex: double getSalary ()
- use a period to call a method or field
- objectReference.methodName
- objectReference.fieldName
- see note for example code
- Employee employee = new Employee () employee.age = 24 employee.salary = 50000
- objectReference.methodName
- Attributes = fields
- class className { [class body] }
- class body contains fields and attributes
- Capitalize initial of each word of each class name
- Objects: living, non-living, abstract, or concrete
The Method Main
- Entry point into the application. Only one class needs it
- Passing arguments to main: java className arg1 arg2 arg3
- Must pass arguments as strings
Constructors: every class needs at least one
- Similar to a method but without a return value
- Must have same name as class
- constructorName (listOfArguments) { [constructor body] }
- One is assigned if you don't write one
Creating Objects
- 'New' command
- new Employee ()
- Employee employee = new Employee ()
- new Employee ()
- 'New' command
Informationen
- Beschreibung
- Mindmap am Object-oriented Programming, erstellt von Rachel Johnson am 18/05/2020.
- Erstellt von
- Rachel Johnson · Mai 2020
- Aktualisiert
- 18 Mai 2020
- Aufrufe
- 0
- Bewertung