¡GoConqr estrena diseño! Cuéntanos qué te parece.

Mapa mental

Chapter 4: Objects and Classes

Jovain Sterling Inglés

Contenido del mapa

Chapter 4: Objects and Classes

  1. Classes

    • Objects/Instance
      • Fields (Attributes)
        • int age; double salary; string position
        • references to objects
          • maxAge, validAddress,age
      • Methods (Actions or Functions)
        • work (); receiveSalary ()
        • define actions
        • declaration/signature of the method
          • consists of: return value, method name, and list of arguments
          • returnType methodName (listofArguments)
        • body
          • contains code that perform the action
        • return type: can be a primitive, an object, or void
          • void: nothing
        • accepts an argument:
          • int negate (int number)
        • does not accept arguments:
          • double getSalary ()
        • two or more arguments
          • int add (int a, int b)
        • main method
          • public static void main (String [ ] args)
          • java className arg1 arg2 arg3
      • creating objects:
        • new Employee () ;
        • Reference Variable
          • assign created object to a reference variable
            • Employee employee = new Employee () ;
              • employee is an object reference of type Employee
          • null keyword
            • when a reference variable does not have a value
            • Book book = null
      • objectReference.methodName
      • objectReference.fieldName
    • class Employee {
    • constructor
      • must have at least one
      • same name as class
      • no return value or void
      • constructorName (listofArguments) { [constructor body] }

Información

Descripción
Mapa Mental sobre Chapter 4: Objects and Classes, creado por Jovain Sterling el 27/05/2021.
Creado por
Jovain Sterling
Visitas
0
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?