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

Mind map

Object-Oriented Programming: Using real life situations to create a model to solve a problem

Aubrey Schnars English

Map content

Object-Oriented Programming: Using real life situations to create a model to solve a problem

  1. Java object: has attributes (fields) and performs actions (methods)

    • Java objects represent real-world objects but with less details
      • To assign a created object with an object variable: Ex: Employee employee = new Employee();
      • To call an objects methods or fields: objectReference.methodName objectReference.fieldName
  2. Java class: a tempate to create objects of similar types

    • Syntax for a class: class className { [class body] }
      • Each word in a class name is capitalized. ex: Employee, DateUtility
      • Class file must be saved as className.java
  3. Fields: variables that are primitive or references to other objects

    • Should follow camel naming convention. Ex: age, maxAge
  4. Methods: actions that an object can take

    • Method declaration contains a return value, method name, and list of arguments
      • Declaration syntax: returnType methodName {listofArguments}
      • Return type void means that the method returns nothing
      • ex: Address getAddress() // returns an address object
    • Constructor method: Constructs the object and does not have a return value
      • The compiler will add one for you if not defined
  5. "main" provides the entry point to the application

    • Syntax for the main class: public static void main {String[] args}

Information

Description
Mind Map on Object-Oriented Programming: Using real life situations to create a model to solve a problem, created by Aubrey Schnars on 28/05/2021.
Created by
Aubrey Schnars
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?