0% found this document useful (0 votes)
237 views

OOPs Notes

This document provides an overview of object-oriented programming concepts like classes, objects, encapsulation, abstraction, polymorphism. It includes definitions and examples of each concept. Various code links are also provided for online practice. The document encourages sharing the link to motivate and helps learn object-oriented programming concepts for placements.

Uploaded by

Evan Subedi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
237 views

OOPs Notes

This document provides an overview of object-oriented programming concepts like classes, objects, encapsulation, abstraction, polymorphism. It includes definitions and examples of each concept. Various code links are also provided for online practice. The document encourages sharing the link to motivate and helps learn object-oriented programming concepts for placements.

Uploaded by

Evan Subedi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Watch video of this PDF: https://youtu.

be/OQ0En1dQ3zI
Course Link: https://www.knowledgegate.in/learn/Mera-Placement-Hoga
Subscribe our Youtube Channel for Coding & Placement Videos: https://www.youtube.com/c/KGPlacementPrep
Join our Free Whatsapp Group for CODING Practice & Job Updates: https://linktr.ee/KgPlacementWA
Share Link of this PDF to friends, this will motivate us: http://tiny.cc/OOPs
• Objects have state and behaviour
Eg: Dogs have state (name, colour, breed, hungry) and behaviour
(barking, fetching, wagging tail).

• An object stores its state in fields (or in variables) and exposes its
behaviour through methods.

Watch video of this PDF: https://youtu.be/OQ0En1dQ3zI


• A class is the blueprint of an object. When you write a
class, you are describing how the JVM should make an
object of that type.

Course Link: https://www.knowledgegate.in/learn/Mera-Placement-Hoga


Subscribe our Youtube Channel for Coding & Placement Videos: https://www.youtube.com/c/KGPlacementPrep
Join our Free Whatsapp Group for CODING Practice & Job Updates: https://linktr.ee/KgPlacementWA
Code Link: https://onlinegdb.com/0ZJ4T5mrs

Share Link of this PDF to friends, this will motivate us: http://tiny.cc/OOPs
Watch video of this PDF: https://youtu.be/OQ0En1dQ3zI
Code Link: https://onlinegdb.com/3bxjXPjGi

Course Link: https://www.knowledgegate.in/learn/Mera-Placement-Hoga


Code Link: https://onlinegdb.com/EQYtvjOAs

Subscribe our Youtube Channel for Coding & Placement Videos: https://www.youtube.com/c/KGPlacementPrep
How to create an object ?

Join our Free Whatsapp Group for CODING Practice & Job Updates: https://linktr.ee/KgPlacementWA
Encapsulation is defined as the wrapping up of data under a single unit.
It is the mechanism that binds together code and the data it
manipulates. Another way to think about encapsulation is, it is a
protective shield that prevents the data from being accessed by the code
outside this shield.

Technically in encapsulation, the variables or data of a class is hidden


from any other class and can be accessed only through any member
function of its own class in which it is declared.

Share Link of this PDF to friends, this will motivate us: http://tiny.cc/OOPs
Watch video of this PDF: https://youtu.be/OQ0En1dQ3zI
Code Link: https://onlinegdb.com/JVvfLlNB1p

Course Link: https://www.knowledgegate.in/learn/Mera-Placement-Hoga


Instance variables are declared private to prevent misuse.

Providing methods that can be used to read/write the


state rather than accessing the state directly.

Subscribe our Youtube Channel for Coding & Placement Videos: https://www.youtube.com/c/KGPlacementPrep
Code Link: https://onlinegdb.com/3iLwksjQZ

Join our Free Whatsapp Group for CODING Practice & Job Updates: https://linktr.ee/KgPlacementWA
Share Link of this PDF to friends, this will motivate us: http://tiny.cc/OOPs
Code Link: https://onlinegdb.com/3iLwksjQZ

Watch video of this PDF: https://youtu.be/OQ0En1dQ3zI


Course Link: https://www.knowledgegate.in/learn/Mera-Placement-Hoga
Subscribe our Youtube Channel for Coding & Placement Videos: https://www.youtube.com/c/KGPlacementPrep
Join our Free Whatsapp Group for CODING Practice & Job Updates: https://linktr.ee/KgPlacementWA
Share Link of this PDF to friends, this will motivate us: http://tiny.cc/OOPs
Code Link: https://onlinegdb.com/9bMLS-jLBu

Watch video of this PDF: https://youtu.be/OQ0En1dQ3zI


Course Link: https://www.knowledgegate.in/learn/Mera-Placement-Hoga
Subscribe our Youtube Channel for Coding & Placement Videos: https://www.youtube.com/c/KGPlacementPrep
Join our Free Whatsapp Group for CODING Practice & Job Updates: https://linktr.ee/KgPlacementWA
Abstraction means displaying only essential information and hiding the details.
Data abstraction refers to providing only essential information about the data to
the outside world, hiding the background details or implementation.

Consider a real life example of a man driving a car. The man only knows that
pressing the accelerators will increase the speed of car or applying brakes will stop
the car but he does not know about how on pressing accelerator the speed is
actually increasing, he does not know about the inner mechanism of the car or the
implementation of accelerator, brakes etc in the car. This is what abstraction is.

Share Link of this PDF to friends, this will motivate us: http://tiny.cc/OOPs
Watch video of this PDF: https://youtu.be/OQ0En1dQ3zI
Course Link: https://www.knowledgegate.in/learn/Mera-Placement-Hoga
Subscribe our Youtube Channel for Coding & Placement Videos: https://www.youtube.com/c/KGPlacementPrep
Join our Free Whatsapp Group for CODING Practice & Job Updates: https://linktr.ee/KgPlacementWA
Code Link: https://onlinegdb.com/3iLwksjQZ

Share Link of this PDF to friends, this will motivate us: http://tiny.cc/OOPs
The word polymorphism means having many forms. In simple words, we can
define polymorphism as the ability of a message to be displayed in more than
one form.

Watch video of this PDF: https://youtu.be/OQ0En1dQ3zI


Course Link: https://www.knowledgegate.in/learn/Mera-Placement-Hoga
Subscribe our Youtube Channel for Coding & Placement Videos: https://www.youtube.com/c/KGPlacementPrep
Join our Free Whatsapp Group for CODING Practice & Job Updates: https://linktr.ee/KgPlacementWA
Code Link: https://onlinegdb.com/Uqd1Wde_wa

Share Link of this PDF to friends, this will motivate us: http://tiny.cc/OOPs
Watch video of this PDF: https://youtu.be/OQ0En1dQ3zI
Code Link: https://onlinegdb.com/EN3AorR8x

Course Link: https://www.knowledgegate.in/learn/Mera-Placement-Hoga


Sections Covered
Sections Covered
Course Link: https://www.knowledgegate.in/learn/Mera-Placement-Hoga

Student Reviews: https://www.knowledgegate.in/learn/home/Mera-Placement-Hoga/reviews

You might also like