GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Mindmap

Object-oriented Programming

Rachel Johnson Englisch

Inhalt der Mindmap

Object-oriented Programming

  1. 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)
      • 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
    • class className { [class body] }
      • class body contains fields and attributes
      • Capitalize initial of each word of each class name
  2. 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
  3. 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
  4. Creating Objects

    • 'New' command
      • new Employee ()
        • Employee employee = new Employee ()

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

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck