BASIC CONCEPT OF OOPS

BASIC CONCEPTS OF OOPS
OBJECTS
An entity that has state and behavior
CLASSES
A group of objects which have common properties
Syntax: class Myclass{ //field; //method; }
Syntax: 'new' - a keyword to initialize an object in java
ABSTRACTION
A process of hiding the details and showing functionality
Syntax: 'abstract' - keyword to declare an abstract class. Achieved by 'Interface' concept.
ENCAPSULATION
A process of wrapping code and data together into a single unit
Making all the data members of the class private, makes that class fully encapsulated .
INHERITANCE
A mechanism where one object acquires alla the properties of a parent object
Syntax: class Subclass-name extends Superclass-name{ //methods and fields } Achieved by 'interface'.
POLYMORPHISM
Can perform a single action in different ways
1.Compile-time Polymorphism: by method overloading. 2.Run-time Polymorphism: by method overriding.
DYNAMIC BINDING
The method call is bonded to the method body at runtime
Can be achieved by virtual functions.
MESSAGE COMMUNICATION
Set of objects communicate with each other
Create class that defines objects. Create objects from definition.
19