GoConqr has a new look! Let us know what you think.

Mind map

Objects and Classes

Logan Grimail English

Map content

Objects and Classes

  1. Classes

    • Classes are the templates that are used to create objects
      • For instance a class titles car could create two different objects
        • Car 2
          • color : red
            • license plate : sp33d
              • horsepower : 1000
        • Car 1
          • color : blue
            • license plate : 53jf1j4
              • horsepower : 300
                • although both cars are from the same class (or template) theyy are theyre own object
    • Classes are declared using two pieces of information
      • the class name
        • what the class will be called
        • It is common to capitalize the first letter of every word in a class name
          • for example: ClassName
      • the class body
        • showing what information will be inserted into the class
  2. Objects

    • Objects have two featurs
      • actions (fields)
        • for instance the object of a car would have the actions of accelerate, brake, park, etc.
        • Fields are variables that can also refer to objects
          • because of this it is posible that an object can contain other objects
      • attributes (methods)
        • for instance the object of a car would have the attributes color, number of tires, plate number etc.
        • Methods are what define what an objects class is able to do
        • to declare methods:
          • returnType methodName (listOfArguments
            • (the list of arguments can be empty though)
      • both of these are optional as some may have one and not the other, or some objects may have both
  3. Also... every class must contain a constructor before creating an object

    • the syntax for the constructor is..
      • constructorName ( ListOfArguments) {
        • [constructor body]
          • }

Information

Description
Mind Map on Objects and Classes, created by Logan Grimail on 26/01/2020.
Created by
Logan Grimail
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?