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

Mind map

Class

Andy Gil English

Map content

Class

  1. Blueprint for an Object

    • Object (requires class)
      • Living
        • Persons
        • Pets
      • Not-living
        • Cars
        • Houses
      • Concrete
        • Books
        • Television
      • Abstract
        • Love
        • Knowledge
        • Tax Rate
      • Creating Objects (instance)
        • Create=Construct=Instantiate
        • to create an Employee object
          • new Employee ();
  2. Needs Methods

    • Define actions that a class's objects can do
      • Method Main
        • Provides entry point to an application
        • signature of main
          • public static void main(String[] args)
        • Passing an argument to main
          • java className arg1 arg2 arg3 ...
          • arguments passed as Strings
            • java Test 1 safeMode
    • declaring a method:
      • returnType methodName (listOfArguments)
        • Return Type
          • primitive
          • object
          • null
      • If method takes more than one argument, arguments separated by comma
        • int add (int a, int b)
    • method that returns an address object
      • Address getAddress
    • method that accepts an argument
      • int negate(int number)
  3. Class definition saved same name as class name

  4. Has fields

    • age
    • maxAge
    • address
    • validAddress
    • numberOfRows
  5. Constructors (all classes must have them

    • constructorName (listOfArguments) ( [Constructor body]
    • arguments used to initialize fields
  6. Null Keyword

    • If a reference doesn't have a value, it has a null value
      • Book book // book is null
    • If object is not assigned:
      • Book book = null

Information

Description
Mind Map on Class, created by Andy Gil on 21/05/2021.
Created by
Andy Gil
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?