Mind map
OOP - Objects and Classes
Map content
OOP - Objects and Classes
Java Objects
- have attributes
- known as fields - fields are optional
- can perform actions
- known as methods - methods are optional
- also called an instance
- have attributes
Class
- a blueprint or template to create objects of a similar type
- class name
- capitalize the initial of each word - Pascal naming convention
- fields
- variables
- primitives
- references to other objects
- follow the camel naming convention
- first initial of each word, except the first, is capitalized
- variables
- methods
- define actions that a class's objects can do
- declaration
- return value
- void
- the method returns nothing
- object
- primitive
- void
- method name
- list of arguments
- return value
- body
- contains code to perform an action
- the special method main provides the entry point to an application
- represented by a rectangle in UML class diagrams
- constructors
- used to construct an object
- is sometimes called a constructor method
- has no return
- may have zero argument
- creating an object from a class
- "construct" or "instantiate"
- new keyword following by the constructor of the class
- can assign a created object to an object variable (or reference variable)
- can call an object's methods and fields by using the object reference
- null = when a reference variable does not have a value
UML Class Diagrams
- provides a quick summary of fields and methods
- can include field types and method signatures
- provides a quick summary of fields and methods
Information
- Description
- Mind Map on OOP - Objects and Classes, created by Hadley Browder on 29/08/2019.
- Created by
- Hadley Browder
- Views
- 1
- Rating