1. FEATURES OF OBJECT
ORIENTED PROGRAMMING
NAME – SWAGATO BISWAS
MAKAUT REGISTRATION NUMBER -222892410170
MAKAUT ROLL NO. - 289950522002
COURSE – BSC. IN GAMING AND MOBILE APPLICATION DEVELOPMENT
PAPER NAME – OBJECT ORIENTED PROGRAMMING
PAPER CODE – GAM 201
2. INTRODUCTION
Object-Oriented Programming (OOP) is a programming concept that emphasizes the use of objects,
classes, inheritance, and polymorphism. OOP is based on the idea of encapsulating data and behavior
within a single unit, known as an object. This provides a way to organize and structure code in a more
intuitive and modular way.
Java is an object-oriented programming language that supports the following six key OOP concepts
• CLASS
• OBJECTS
• INHERITENCE
• ENCAPSULATION
• ABSTRACTION
• POLYMORPHISM
3. CLASS
In Java, a class is a blueprint or a template that describes the characteristics and behaviors of an object. A
class can be used to create one or more objects that share the same properties and methods.
The properties of a class are defined by its variables, which represent the state of the object. The methods
of a class define the behaviors or actions that can be performed on the object.
4. OBJECTS
In Java, an object is an instance of a class that encapsulates data and behavior. Objects are created from
classes using the "new" keyword and can be used to perform operations, manipulate data, and interact
with other objects in the program.
An object in Java has two main components: state and behavior. The state of an object is represented by its
variables or fields, which store the object's data. The behavior of an object is represented by its methods,
which define the actions that the object can perform.
5. INHERITENCE
Inheritance is one of the fundamental concepts of object-oriented programming (OOP) in Java. It allows a
subclass or child class to inherit the properties and behaviors of its superclass or parent class. Inheritance
in Java provides the following benefits:
• Code Reusability: Inheritance allows a subclass to reuse the code of its parent class, which reduces the
amount of code duplication and helps in maintaining the code.
• Code Maintainability: Inheritance helps in organizing the code in a hierarchical structure, making it
easier to maintain and update the code.
• Polymorphism: Inheritance is the foundation of polymorphism, which allows objects of different classes
to be treated as objects of a common superclas
6. ENCAPSULATION
Encapsulation is one of the fundamental concepts of object-oriented programming (OOP) in Java. It is the process of binding
data and code together and restricting access to data from unauthorized users. Encapsulation in Java provides the following
benefits:
• Data hiding: Encapsulation allows the programmer to hide the implementation details of the class from the outside world.
This helps to prevent unauthorized access to the data and provides security.
• Improved code maintainability: By hiding the implementation details of the class, encapsulation helps to reduce code
complexity, making it easier to maintain and update the code.
• Modularity: Encapsulation allows the programmer to develop modules that can be reused in different contexts.
In Java, encapsulation is achieved by declaring the class variables as private and providing public getter and setter methodsto
access and modify the data. The private access modifier restricts the access to the class variable from outside the class, while
the public getter and setter methods provide a controlled way of accessing and modifying the data.
7. ABSTRACTION
Abstraction is one of the fundamental concepts of object-oriented programming (OOP) in Java. It is the process of
hiding the implementation details of a class and exposing only the necessary information to the outside world.
Abstraction in Java provides the following benefits:
• Reduced complexity: Abstraction helps to reduce the complexity of the code by hiding the implementation
details and exposing only the essential information.
• Increased maintainability: Abstraction makes the code more modular and reusable, making it easier to
maintain and update the code.
• Polymorphism: Abstraction is the foundation of polymorphism, which allows objects of different classes to be
treated as objects of a common superclass.
In Java, abstraction is achieved by using abstract classes and interfaces. An abstract class is a class that cannot be
instantiated and can only be used as a superclass for other classes. An interface is a collection of abstract
methods and constants that can be implemented by a class
8. POLYMORPHISM
Polymorphism is one of the fundamental concepts of object-oriented programming (OOP) in Java. It is the ability
of objects of different classes to be treated as objects of a common superclass. Polymorphism in Java provides
the following benefits:
• Code reusability: Polymorphism allows objects of different classes to be treated as objects of a common
superclass, which makes it easier to reuse the code.
• Flexibility: Polymorphism makes the code more flexible by allowing objects of different classes to be treated
uniformly.
• Extensibility: Polymorphism makes it easier to extend the functionality of a class by adding new subclasses.