Mapa mental
Object Oriented Programming
Contenido del mapa
Object Oriented Programming
Java Object
- Attributes/fields and Actions/methods
- to create an object from a class "new" is always followed by the construtor of the class to be instantiated
Java Classes
- template for objects
- class determines object
- class name, the fields, the methods
- Ex. Employee, Boss, DateUtility, PostOffice, RegularRateCalculator
- Methods (responsibilities)
- define actions that a class's objects can do
- declaration: return value, method name, list of arguments
- body: contains code that performs the action
- Examples
- returnType methodName (listOfArguments)
- double getSalary ( )
- Address getAddress ( )
- int negate (int number)
- this method accepts an argument
- int add(int a, int b)
- this method takes more than one argument
- int negate (int number)
- Address getAddress ( )
- double getSalary ( )
- returnType methodName (listOfArguments)
- Examples
- body: contains code that performs the action
- declaration: return value, method name, list of arguments
- define actions that a class's objects can do
- Fields
- a variable; can refer to another object
- Ex. address, validAddress, numberOfRows
- Constructors: used to construct an object, every class must have
- constructorName (listofArguments) { [constructor body] }
- template for objects
Información
- Descripción
- Mapa Mental sobre Object Oriented Programming, creado por Michael Roberts el 17/01/2020.
- Creado por
- Michael Roberts
- Visitas
- 0
- Valoración