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

Mind map

Object and Classes

Anabella Vazquez English

Map content

Object and Classes

  1. Java Object

    • Features
    • Attributes (Fields)
    • Actions (Methods (Functions))
    • Examples
      • Some Java Objects may not have fields but have methods
      • Some Java objects have fields but not methods
      • Some Java objects have both fields and methods
      • Some Java objects have neither
  2. Java Classes

    • A class is a blueprint to create objects
    • A Class determines what objects you get
      • Example
        • If you create an Employee class that has age and position fields, all employee objects created out of this class will have age and position fields as well
    • Classes are OOP tool that enables programmers to create the abstraction of a problem
    • Fields
      • Fields are variables and they also refer to another object
    • Methods
      • Methods define actions that a class's objects can do
        • If a method takes more than one argument, two arguments are separated by a comma
      • A special method called main provides the entry point to an application.
    • Constructor
      • Every class must have at least one constructor. Otherwise, no objects could be created out of the class and the class would be useless.
      • The second constructor is particularly useful. Without it, to assign values to age and position, you would need to write extra lines of code to initialize the fields.
  3. The Null Keyword

    • When a reference does not have a value, it is said to have a null value.
    • If you declare a local reference variable within a method but do not assign an object to it, you will need to assign null
    • You can test if a reference variable is "null" by using == operator
  4. Creating Objects

    • An object is also called an instance
    • There are many ways to create an object, but the most common one is by using the "new" keyword followed by the constructor of the class to be installed.

Information

Description
Mind Map on Object and Classes, created by Anabella Vazquez on 29/08/2019.
Created by
Anabella Vazquez · Aug 2019
Updated
Sep 8, 2019
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?