Mind map
Ch 4: Objects & Classes
Map content
Ch 4: Objects & Classes
OOP: Creating a model that resembles real-life situation
OBJECT
- FIELDS
- Variables; can be primitives or references to objects
- METHODS
- Define actions that a class's object can do
- DECLARATION
- Consists of return value, method name, & a list of arguments
- Return type can be:
- Primitive
- An object
- Void
- Method returns nothing
- Null
- Nothing
- Return type can be:
- Consists of return value, method name, & a list of arguments
- BODY
- Contains code that perform action
- Types of Actions
- Create
- Read
- Update
- Delete
- Types of Actions
- Contains code that perform action
- The Method Main
- Provides the entry point to an application - only one of the classes needs to have one
- An element that corresponds to the properties of a specific class
- DATA TYPES
- Primitive/SImple
- Boolean
- T/F
- Int
- ..-1000..0..1000...
- Double
- 3.14159265
- Char
- 'a' 'b' 'c'
- Boolean
- Composite/Complex
- String
- Words & Sentences
- String
- Primitive/SImple
- FIELDS
CLASS
- Blueprint/Template to create objects of identical type - all program elements reside in a class
- When writing a class, consider:
- Class Name
- Fields
- Methods
- CONSTRUCTOR
- Used to construct an object - looks like a method, however does not have a return value
- Every class needs at least 1
- Used to construct an object - looks like a method, however does not have a return value
- General scenario - represents an element from problem's world/context
Information
- Description
- COP2800 Mind Map on Ch 4: Objects & Classes, created by Samantha Sullivan on 08/27/2019.
- Created by
- Samantha Sullivan
- Views
- 4
- Rating