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

Mind map

Ch. 4 Objects and Classes

Jose Hernandez English

Map content

Ch. 4 Objects and Classes

  1. What is a Java Object?

    • OOP can be used to show and solve real-life situations
    • Java objects have attributes and actions called fields and method, respectively
      • Fields and methods are optional
    • Classes are used to create Java objects
  2. Java Classes

    • Class determines the object
    • Consider 3 things when writing a class
      • Class name
      • The fields
      • The methods
  3. Fields

    • variables that can reference to objects
    • Follow camel naming convetion
      • ie. maxAge
  4. Methods

    • define what objects can do
    • Has declaration and body part
      • Declaration part
        • Return value
          • can be a primitive (field)
          • can be object
          • can be void
        • method name
        • list of arguments
      • body part
        • code that performs action
  5. Method "main"

    • Provides entry to application
    • allows class containing to be invoked
  6. Constructors

    • Every class needs at least 1 constructor
      • compiler adds 1 if not specified
    • no return value
  7. Creating Objects

    • use "new"
    • usually create reference variable
  8. null Keyword

    • no return value
    • Test if reference variable is null with "==" operator

Information

Description
Mind Map on Ch. 4 Objects and Classes, created by Jose Hernandez on 18/05/2020.
Created by
Jose Hernandez
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?