0% found this document useful (0 votes)
28 views15 pages

Object Oriented Programing: Tapas Mandal

Uploaded by

yourstapas
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)
28 views15 pages

Object Oriented Programing: Tapas Mandal

Uploaded by

yourstapas
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/ 15

Object Oriented

Programing
Tapas mandal
Class Object

Encapsulation Inheritence

OOPs
Polymorphism

Presentation Title
Presentation title 2
Class
A class is a collection of objects that defines a set of
properties that is common to all objects of a
particular type. It can also be called a blueprint for
creating objects. A class entails the following
components:

Presentation title 3
Class name: The name given to a class starting with
a capital alphabet.

ANNUAL Modifiers: Based on the functionality of the class


REVENUE modifiers can either be public, private or default.
GROWTH
Body: The class body contains all the codes on the
objects present in the class. This could range from
declaring any variables or creating any constructor
or methods that contain the functioning of an object.
Object
An object is defined as an instance of a class and contains
real-life entities. For instance, for a class called Animals, Its
objects will be a cat, dog, elephant et al. Each object has its
own identity, attribute, and behaviour. The code below
depicts the use of class, object, and method while
programming in the java language.

Presentation title 5
Methods
Methods are defined within a class and are used to perform a specific function. The method may or may not
contain an input parameter. The code below depicts the use of class, object, and method while programming in the
java language.

Presentation title 6
Inheritance
The term inheritance refers to inheriting the properties of one class to another. The properties refer to the attributes and
methods of the parent class. The parent class is that class whose properties need to be inherited by other classes. The
classes that inherit the properties of the parent class are called the child class or subclass. To inherit the properties of the
parent class into the child class, a keyword called extends is used.

Presentation title 7
Access Modifiers
The access modifiers in Java defines the accessibility or extent of
a method or constructor or the class. The four types of access
modifiers are:

1.Public: The code written within a class is accessible to other


classes.
2.Private: The code written is only accessible within that specific
class.
3.Default: The code written is accessible within the same
package.
4.Protected: The code is accessible within a package and also
through a subclass. In the absence of a child class, the code cannot
be accessed.

Presentation title 8
Polymorphism
As the name suggests- Polymorphism is the ability of a variable or a function to exist in multiple
forms. Polymorphism allows the programmer to perform different tasks using the same variable or
function. A real-life example of polymorphism would be- consider an open ground, now this ground
can be used for playing sports.
Besides, it could also be used to organize weddings and concerts. Lastly, the same ground can be used
for parking vehicles. From this, we can infer that a single variable can have multiple implementations
depending upon its usage.
The polymorphism we usually come across two terms namely- Method overloading and Method
overriding.
In Method Overloading, a single method can be used in numerous ways and perform different
functions. The methods will have the same name but different parameters can be used as input.
In Method Overriding, the method of the parent class can be overridden by the child class. With this,
the same method can perform differently when invoked by the parent class and by the child class.

9
Polymorphism

10
Abstraction
Abstraction is the process of hiding certain data from the users and showing only
the required information to them. For instance, while driving a car, we are not
concerned about internal functions or mechanisms. What is shown to us are the
speed at which the car is being driven and the litres of petrol available. All the
other marginalized data are not displayed to the driver.
The abstract keyword is used for methods and classes while performing
abstraction. For an abstract class, we cannot create an object while the abstract
method should not include a body. If any of the two rules are violated, the output
will generate an error.

11
Abstraction

12
Encapsulation
Encapsulation is the process of binding the code and the data
together into a single unit. Here, the variables of a class are
hidden from other classes (by using the keyword private) but
can only be accessed through a member function. Setter and
getter functions are used to access the private variables of a
class that is abstract.
Advantages of the OOP concept.

1.The code can easily be reused and therefore saves a lot of


time and cost for the development of codes.
2.It helps in designing the code in a well-structured manner so
that any new programmer does not have to spend long hours
to understand the code.
3.Besides helping users in writing code efficiently, it makes
sure that security is not compromised.

Presentation title 14
Thank you
Tapas Mandal
[email protected]

You might also like