KEMBAR78
OOP Features Java Presentation | PDF | Class (Computer Programming) | Inheritance (Object Oriented Programming)
0% found this document useful (0 votes)
4 views10 pages

OOP Features Java Presentation

The document introduces the Object-Oriented Programming (OOP) paradigm, highlighting key concepts such as classes, objects, abstraction, encapsulation, inheritance, and polymorphism. It explains that a class serves as a blueprint for creating objects, which are instances of classes that can access member variables and functions. Additionally, the document provides syntax examples for each concept to illustrate their implementation in programming.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views10 pages

OOP Features Java Presentation

The document introduces the Object-Oriented Programming (OOP) paradigm, highlighting key concepts such as classes, objects, abstraction, encapsulation, inheritance, and polymorphism. It explains that a class serves as a blueprint for creating objects, which are instances of classes that can access member variables and functions. Additionally, the document provides syntax examples for each concept to illustrate their implementation in programming.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Introduction to Object –

Oriented Programming Paradigm


• Collection of Object
• Each object consists of data attributes and Methods
• Bottom Up Approach
• Data can be protected from accidental Modification
Example

Class Data Attributes Methods


Person ID Eat
Name Study
Age Sleep
Address
Features of OOP
• Class
• Object
• Abstraction
• Encapsulation
• Inheritance
• Polymorphism
1. Class
• A Class can be defined as an entity (separate unit) in which data and
function are put together
Syntax
class name_of_class
{
Private:
variable declaration;
function declaration;
Public:
variable declaration;
function declaration;
}
1. Class
• - A blueprint for creating objects

Syntax:
class Car {
Public:
int speed;
Private:
void drive() {
System.out.println("Driving...");
}
}
2. Object
• Object is as an instance(part) of a class
• Using object we can access the member variable
and member function of a class
• Object represent a person, place or any item

Syntax:
Class_name object_name;
Car myCar ;
myCar.drive();
3. Abstraction
• - Represent only essential features Hides internal implementation
• - Achieved using abstract classes or interfaces

Syntax:
Class student
{
Private:
Int rollno;
Char name[10];
Public:
Void input();
Void display();
};
Example
Student s1;
S1.input();
S1.display();
4. Encapsulation
• - Binding of data and methods into a single unit
• - Use private fields and public methods

Syntax:
class Student {
private int age;
public void setAge(int a) { age = a; }
public int getAge() { return age; }
}
5. Inheritance
• - Inheritance is a property by which the new classes are created using the
old classes
• Inheritance support hierarchical structure
• Old classes – base classes
• New classes – derived classes
Derived class inherit the properties of the base class
Syntax:
class Animal {
void eat() { System.out.println("Eating"); }
}
class Dog extends Animal {
void bark() { System.out.println("Barking"); }
}
6. Polymorphism
• - Many Structures
• Polymorphism is the ability to take more than
one form and refers to an operation exhibiting
different behavior in the different instances
• The name of the function remains same but it
can perform different tasks
• Example
• Class clean

You might also like