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

Mindmap

Ch.4 Object and Classes

Michael Marinskiy Information Technology Englisch

Inhalt der Mindmap

Ch.4 Object and Classes

  1. Java Objects - a model of a real life object within Java that helps you solve the problem you are trying to solve using code.

    • Attributes/fields - the characteristics of an object within Java, such as a name, age, color, etc.
    • Actions/methods - actions that the object is able to perform, such as counting, assigning, getting, and setting.
    • To create/instantiate a new object in a Java class the keyword "new" is most commonly used. Once the object is created, you can call its methods and access its fields by using the object reference that was assigned to the object and a period (.) to call upon the methods and fields.
      • Want to assign created object to an object variable or reference variable so that you can manipulate the new object later. Employee employee = new Employee();
  2. Java Classes: Template to create objects of similar types, tool in OOP that allows programmers to create an abstraction of the problem. Fundamental building blocks of Java program.

    • Naming conventions
      • Class name always Capitalized, ex: Employee, PostOffice
      • Attribute/field name follows Camel naming convention
    • Fields: Variables, primitive or reference objects. One object can contain another object within its attributes.
    • Methods: Define actions that class's objects do. Each method must have a declaration and a body.. Declaration is performed using the syntax: returnType methodName (listOfArguments). Return type can be a primitive, an object, or void. Return type void means the method returns nothing.
      • Constructor: Each class must have at least one, used to construct an object, no return value, saves time when adding object
    • Method Main - a special method that provides entry point into the application for the user to interact with it. Signature: public static void main(String[] args)

Informationen

Beschreibung
Information Technology Mindmap am Ch.4 Object and Classes, erstellt von Michael Marinskiy am 09/07/2020.
Erstellt von
Michael Marinskiy
Aufrufe
1
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck