Mapa mental
Objects and Classes
Conteúdo do mapa
Objects and Classes
what is an Object?
- Objects are everywhere, can be concrete (things) or abstract (ideas and knowledge)
- has attributes (fields), that can perform actions (methods)
- created by using "new" and the keyword of the object
- once the object is created it can be used to call methods and access fields
- created by using "new" and the keyword of the object
- an object can contain other objects
- when there is not a value associated it is considered null
What is a Class?
- To create an object we need the blueprint for that object, a class
- THE FUNDAMENTAL BUILDING BLOCK OF JAVA!
- the declaration of class must use the word "Class" followed by the class name and the body must use brackets
- a class must also have a class definition that is saved in a file that has the same name as the class
- the declaration of class must use the word "Class" followed by the class name and the body must use brackets
- field
- also called attribute, are variables that could be primitive data or objects
- name
- method
- actions that a class's object can do
- the return can be primitive, an object, or void
- the method main is the entry point to an application
- needed by only one class
- actions that a class's object can do
- Can be represented by a UML class diagram: top is the class name, middle are the class attributes (fields), bottom is the class method
- EVERY class must have a CONSTRUCTOR
- used to construct an object
- usually does not have a return value
- must have the same name as the class
Informações
- Descrição
- Mapa Mental sobre Objects and Classes, criado por Elizabeth Noonan em 10-06-2020.
- Criado por
- Elizabeth Noonan
- Visualizações
- 0
- Avaliação