0% found this document useful (0 votes)
9 views11 pages

Week2 Lab Programs

The document discusses key concepts of Object-Oriented Programming (OOP) in Java, focusing on inheritance, polymorphism, encapsulation, and abstraction. Inheritance allows one class to inherit features from another, while polymorphism enables messages to be displayed in multiple forms. Encapsulation combines data and methods in a class, hiding implementation details, and abstraction simplifies complex systems by exposing only necessary information.

Uploaded by

vadlasadvik99
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)
9 views11 pages

Week2 Lab Programs

The document discusses key concepts of Object-Oriented Programming (OOP) in Java, focusing on inheritance, polymorphism, encapsulation, and abstraction. Inheritance allows one class to inherit features from another, while polymorphism enables messages to be displayed in multiple forms. Encapsulation combines data and methods in a class, hiding implementation details, and abstraction simplifies complex systems by exposing only necessary information.

Uploaded by

vadlasadvik99
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/ 11

Inheritance:

Definition:
 Java, Inheritance is an important pillar of
OOP(Object-Oriented Programming).

 It is the mechanism in Java by which one class


is allowed to inherit the features(fields and
methods) of another class.
Types of inheritance:

Hierarchical inheritance
Polymorpysam:
• Definition:
• The word ‘polymorphism’ means ‘having many
forms’.
• In Java, polymorphism refers to the ability of a message
to be displayed in more than one form
• Defination:

 Encapsulation in java is a fundamental OOP (object-
oriented programming) principle that combines data
and methods in a class.

 It allows implementation details to be hidden while


exposing a public interface for interaction.
Types in polymorphism:
Encapsulation
• Defination:

 Encapsulation in java is a fundamental OOP (object-
oriented programming) principle that combines data
and methods in a class.

 It allows implementation details to be hidden while


exposing a public interface for interaction.
Abstraction:
• Abstraction in Java refers to hiding the implementation
details of a code and exposing only the necessary
information to the user. It provides the ability to simplify
complex systems by ignoring irrelevant details and
reducing complexity.
Example program:

You might also like