Lecture 02 - POP vs. OOP, Java Features, Class, Object
Lecture 02 - POP vs. OOP, Java Features, Class, Object
Class:
A class is a group of objects which have common properties. It is a template or blueprint from
which objects are created. It is a logical entity. It can't be physical.
A class in Java can contain: Fields, Methods, Constructors, Blocks, Nested class and interface.
Syntax:
class <class_name>{
field;
method;
}
Object:
An entity that has state and behavior is known as an object.
E.g. chair, bike, marker, pen, table, car etc.