Class Flashcards
What are the fundamental concepts that Java supports as an Object Oriented Language?
- Polymorphism
- Inheritance
- Encapsulation
- Abstraction
- Classes
- Objects
- Instance
- Method
- Message Parsing
It is like a blueprint for creating objects
Class
It specifies an object’s attributes and defines its behaviors as methods
Class
How to reference a data member/function?
- Stating the name of the object reference, followed by a period (dot), followed by the name of the member inside the object
- objectReference.member
How to call a method for an object?
- naming the object followed by a period (dot), followed by the name of the method and its argument list
- objectName.methodName(arg1)
An instance of a class
Object
Syntax for creating an object
classname objectname = new classname();
Identify the parts of the following line:
A.length = 10;
A - Object name
length - Object attributes
Identify the parts of the following line:
Rectangle B = new Rectangle();
Rectangle - Class name
B - Object name
Identify the parts of the following line:
A.ComputePerimeter();
A - Object name
ComputePerimeter(); - Object Methods