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

Mindmap

Java Objects

Cody Miller Englisch

Inhalt der Mindmap

Java Objects

  1. Fields

    • Variables applying to an object
      • Ex: Assigning variables like age, salary, position, address, etc. to an object within a class
  2. Classes

    • Blueprints to create objects of the same type and fields.
      • Ex: Creating an employee class with Age and Position field allows creation of Employee objects with Age and Positions as well.
  3. Methods

    • Defines actions which a class's objects can do. Consists of a declaration and a body.
      • Declaration
        • Consists of a return value, method name, and a list of arguments
      • Body
        • Contains the code which performs the action
      • Ex: int add (int a, int b). This method allows us to add 2 integers. Note: when there is more than one argument, use a comma to separate them.
  4. Constructors

    • Used to construct objects. If not defined, the compiler automatically adds one.
      • Ex: public Employee (int ageValue, double salaryValue). This is a constructor which allows creation of an employee object. having the arguments int ageValue and double salaryValue allow the object to be created without adding extra lines of code to initialize the fields.
  5. Creating an Object

    • Once the class is written, you may add objects to it. This is generally done with the 'new' keyword.
      • Ex: new Employee(); this creates a new employee object.
  6. Null Keyword

    • Allows a reference variable to not have a value, such as when not referencing an object.
      • Ex: Book book = null; In this case, the book has a null value.

Informationen

Beschreibung
Mindmap am Java Objects, erstellt von Cody Miller am 27/08/2019.
Erstellt von
Cody Miller
Aufrufe
3
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck