Mapa mental
OOP: object-oriented programming
Conteúdo do mapa
OOP: object-oriented programming
objects
- living eg: people
- concrete eg: book
object
- living eg: people
- concrete eg: book
- abstract eg: idea
class--serve as template in programming, to create identical type of objects
- using Pascal naming convention
- class definition, use the same name as class
- eg: Employee.java for class Employee
field (attributes for objects), using Pascal naming convention, Capitalize the initials
- variables : primitives/references to objects
method (actions for objects) , using camel naming convention, capitalize all initials except the first word
- actions objects do
- declaration of methods is called signature of methods
- method main
- entry to an application
- arguments written as string
return type: primitive/ object/ void (nothing to return)
UML diagram
- class name on the top, lists of fields in the middle and methods in the bottom
- have to have a comma between field and type , arguments as a string , return type is written after colon
constructor
- each class has to have a constructor
- have to use the same name as class
- no-argument constructor
- constructor has no argument
- each class has to have a constructor
the null keyword
- not referencing any object
- "null" will be assigned when declaring a local reference variable within a method but do not sign object to it
- the "==" operator for testing if a reference variable is null
- not referencing any object
create objects
- objects also refer to instance
- instantiate
- use "new" keyword, declare object reference with the same type as object, assign values
Informações
- Descrição
- Mapa Mental sobre OOP: object-oriented programming, criado por Xinyi Ge em 12-09-2020.
- Criado por
- Xinyi Ge · set 2020
- Atualizado
- 12 set 2020
- Visualizações
- 1
- Avaliação