2. WHAT IS CLASS?
CLASS IS A COMBINATION / COLLECTION OF DATA & METHOD THAT
WORKS ON DATA. IT IS DOESN’T TAKE ANY SPACE ON MEMORY.
A class is user defined blueprint or prototype from which object are
created.
CLASS DECELERATION CAN INCLUDE THESE COMPONENTS
1. Modifier: A class can be public or has default access.
2. Class Keyword: Class Keyword is used to create a class.
3. Class name: The name should begin with an initials letter.
4. Body: The class body surrounded by braces{ …..}.
3. CLASS
PRE DEFINED USER DEFINED
• STRING
• SCANNER
• CONSOLE
• SYTEM
• STRING
• DOG
• CAT
• A
• CAR
• HORSE
4. 1. PRE DEFINED : A CLASS WHICH IS ALREADY CREATED & DEFINED BY
DEVELOPER IS CALLED PRE DEFINED CLASS.
2. USER DEFINED : A CLASS WHICH IS CREATED PROGRAMMER ( USER) IS
CALLED USER DEFINED.
Ex.
Class name
{ ………………………………..
………………………………….. // data
…………………………………
…………………………………… // methods
}
5. OBJECT
• It is basic unit of object oriented Programming & represent the real life entities.
• An object consists of three main essential features :
1. State: It is represented by attributes/properties of an object.it also reflect the
properties of an object.
2. Behaviour: It is represented by method of an object.it also reflects the response of
an object with other object.
3. Identity: It gives a unique name to an object and enables one object to interact
with other object
7. Animal
Identity : Name of the dog
Attribute:
Breed:
Color:
Behavoiur:
Eat();
Getcolor();
Plant
Identity: Name of the plant
Attribute:
Name
Type
Behavoiur:
getname();
Getcolor();
VECHICLE
Identity: Name of vechicle
Attribute:
Model
Chasis no
engine
Behavoiur:
Brake
acelerator
OBJECT IS AN INSTANCE OF CLASS THAT EXECUTES THE CLASS. ONCE THE OBJECT IS
CREATED, IT TAKE UP SPACE LIKE OTHER VARIABLES IN MEMORY.
8. OOPS
What is OOPS?
OOP STAND FOR OBJECT ORIENTED PROGRAMMING LANGUAGE, THE MAIN
PURPOSE OF OOP IS TO DEAL WITH REAL WORLD ENTITY USING PROGRAMMING
LANGUAGE.
12. DATA HIDING
THE VARIABLES OF A CLASS WILL BE HIDDEN FROM OTHER CLASSES, AND
CAN BE ACCESSED ONLY THROUGH THE METHODS OF THEIR CURRENT
CLASS IS KNOWN AS DATA HIDING.
DATA = PRIVATE
METHOD = PUBLIC
13. ABSTRACTION
Design may be complex
Keep interface simple
Abstraction is the process of hiding certain details and showing only
essential information to the user.
ALLOW ONLY VERY IMPORTANT
METHOD TO BE VISIBLE
16. INHERITANCE
USE THE EXISTING CLASS DESIGN AND ADD
SOMETHING NEW.
Inheritance in Java is a mechanism in which one object acquires all the properties
and behaviors of a parent object. It is an important part of OOPs (Object Oriented
programming system). YOU CAN REUSE METHODS AND FIELDS OF THE
PARENT CLASS.
18. POLYMORPHISM
POLY MORPHISM
MANY – MORE
THAN ONE
FORMS
MANY FORMS
POLYMORPHISM IS THE
GREEK WORD WHOSE
MEANING IS “ SAME OBJECT
HAVING DIFFERENT
BEHAVIOUR”.