Mind map
OBJECTS and CLASSES
Map content
OBJECTS and CLASSES
Objects
- An entity that can be identified
Class
- The blueprint of method used
Unified Modeling Language (UML)
- a set of standard diagrams for graphically depicting object-oriented systems
Constructors
- Initialize an object’s data.
- Can be overloaded, to construct objects with different initial data values.
- MUST have the same name as the class itself
- DO NOT have a return type – not even void
- Invoked using the new operator when an object is created
- Rectangle rectTwo = new Rectangle(“Yellow”, 2.5, 11.6);
Accessing an Object’s Data and Methods
- data can be accessed and its method invoked(using dot operator)
A Demo Program
- We need a demo program to test a class program
- It must be saved in the same folder or directory
Modifiers
- Control access to data, methods and classes
- Introduces the public, private and default modifiers
- public - classes, methods, and data fields can be accessed from any other classes
- private - methods and data fields can be accessed only from within its defining
- If public and private is not used, then by default the classes, methods and data are accessible by any class in the same package
- Known as package-private or package-access
Nur Nabila Binti Kadri 1141226994 Mdm. Nurul Aini Binti Mohd. Nordan 4147
Information
- Description
- Mind Map on OBJECTS and CLASSES, created by nabila kadri on 20/12/2015.
- Created by
- nabila kadri
- Views
- 1
- Rating