1. OOPs Concept in Java with Examples | 4 Pillars of Object Oriented Programming (OOPs)
HTML-код
- Опубликовано: 10 сен 2023
- ➡️ Notes link: Shared in the Member Community Post (If you are Member of this channel, then pls check the Member community post, i have shared the Notes link there)
➡️ Join this channel to get access to member only perks:
/ @conceptandcoding
There are 4 pillars of OOPs:
- Inheritance,
- Polymorphism,
- Abstraction,
- Encapsulation.
i have all 4 in detailed with different examples. And interview questions which can be asked on top of it.
#java #objectorientedprogramming
00:02 Overview of Object Oriented Programming (OOPs) in Java
02:21 Real world entities have behavior (functionality) and properties
07:09 Objects in OOP have properties and behaviors
09:38 Class is the blueprint/template for creating objects.
15:00 Creating objects using the 'new' keyword in Java
17:31 First pillar of OOPs: Data Abstraction
21:49 Achieving data abstraction through interface and abstraction.
24:07 Data abstraction is essential for user interface simplicity and confidentiality.
28:37 Implement data hiding for simplified code
30:47 Data abstraction simplifies client code
35:30 Encapsulation in OOPs
37:49 Encapsulation bundles data and code into a single unit in Java OOPs
42:15 Object-oriented programming emphasizes the need for information exchange between classes.
44:39 Classes have control over their own properties and methods.
49:08 In OOPs, data can be accessed only through methods, not directly.
51:11 Data encapsulation is like keeping data inside a capsule for protection.
55:41 Understanding the concept of inheritance in Java
58:09 Car type and object creation in OOPs
1:03:25 Inheritance and method ambiguity in object-oriented programming.
1:05:53 Diamond problem in OOPs
1:10:23 Polymorphism in Java
1:12:33 Method overloading is known as static polymorphism or compile time polymorphism.
1:17:19 Method overloading based on return type is not allowed
1:19:25 Overloading vs. Overriding in Java
1:23:52 Method Overloading vs Method Overriding in OOPs
1:26:13 Inheritance and has a relationship in OOPs concept
1:30:48 Understanding 'has a' relationship in OOPs
1:33:16 Objects in OOP are strongly related and impact each other
Wish could get it before, after completing engineering... Got everything
A obj = new B(); - Polymorphic Reference
It's important to note that even though the object is of type B, you are referencing it using a variable of type A. This means that you can only access the methods and fields that are defined in class A through the variable obj. If class A has methods that are overridden in class B, the version of the method in class B will be called when you invoke the method through the obj reference.
If you try to access methods or fields specific to class B using the obj reference, you will encounter a compilation error unless those methods or fields are also present in class A (or its superclasses/interfaces).
Example :-
If class A has methodA( ), methodxyz( ) and class B has method B( ), methodxyz()
& class B inherits class A.
Then, => A obj = new B();
obj. methodA( ) will invoke methodA( ) of class A
obj. methodB( ) will result in compilation error
obj. methodxyz( ) will invoke methodxyz( ) of class B ( methodxyz() is overriden in class B )
bhai kesse log ho sab bande ne itna sahi padaya aur comments mai kisi ne admire phi nni kıya bss gyan de rahe. h
Best session of.my life
Awesome explanations...so simplified. Thanks a lot ☺️
Thanks
What is your view on kotlin ? You can completely write anything just using functions and achieve same functionality as class based paradigm.
nice I got a nice revision after a long one year
Can you make video on functional programming and async and reactive programming
Dear @ConceptandCoding Where can i download the notes for this video
can we pls get the slide here as well ?Thanks
Inheritance best example
Hi Shreyansh, have you shared this slide somewhere?
Bro nice one, but if possible please make this video like the one, you explained memory management & Garbage collection without PPTs
Hi, Plz share the slides, as it will be very helpful for revision or remember the topics
when you upload the springboot and microservices video?
Do these videos cover whole java core. Like in this video concepts are explained in brief and there is no other video of java oops in the playlist
Great Content. Also A Small Request From My Side. Could You Please Also Share and Design Complex MCQs Which Revolve Around These Topics Which Help in Strengthen our concepts
Noted
@sheyansh
In polymorphism, can we change access modifier and exception if any in case of overriding ?
In polymorphism, you cannot change the access modifier to reduce visibility (e.g., from public to private) when overriding a method. However, you can increase visibility (e.g., from protected to public). Regarding exceptions, the overriding method can throw the same, subclass, or no exceptions compared to the overridden method, but it cannot throw broader exceptions.
Hi Shrayansh, have u made all the videos public or there are more vidoes in these playlist? Do i need to join to access the complete playlist
same doubt
Hi Shrayansh, at 25:17 what does this user mean, is it like a client (any other application) that uses our exposed interface methods ?
yes, its client code
Thank u 👍👍
Please add the notes , it will be helpful for revision, please consider it fast.
I like your content. Is it possible for you to share link to all your PPTs / Slides or One Note whichever way you can share the notes so that we don't need to worry about taking notes and instead focus on studying. Whatever slides you've taught on should also suffice.
ack. in most of the videos description i have shared the notes for some its left i will add
Also the diamond problem we can resolve throw interface but how it is working in other language like CPP .. concept will be same for all is it?
I don't know CPP, but my gut feeling is, in CPP should also have this problem (as it's OOPs language only).
Try it out
Where can I find these ppts ?
we call the method after creating the object in both the cases (Method overriding and method overloading) then why one is called as compile time polymorphism and another runtime polymorphism.
I understand the fact that in overriding at runtime it gets decided which methods to call but same also happen in overloading. It seems like silly question. but can anyone answer?
its not a silly question buddy, i have explained it here in depth: ruclips.net/video/Lqan4AF9wzA/видео.html
pls check once, if you still have doubts, we will discuss
Hi shreyansh What is the use of private class if we can't access it. Can you tell any real-life example.
I would say, it's more strongest form of Encapsulation, when you want only the class in which it is defined should access it, then you can use it.
With this you can group method class wise.
Private class should be like TransactionDetails when a payment transaction happens in Gpay.
hii, i joined your membership today, i was expecting the notes will also be shared, hope i am not wrong, cause it will be good for us to revise it before interview.
hi, for mostly, i have added the notes link in the description section, for starting ones also, i will add.
for some initial videos, i will update the description section:
Please find the notes for some initial videos here:
Java: Reflection:
notebook.zohopublic.in/public/notes/u3i1sae669a127ac24a07842a488207750a7c
Java: Functional Interface and Lambda Expression:
notebook.zohopublic.in/public/notes/u3i1sa79b68153abe44d5aa93cc1d5b9f4dd9
Java: Interface in Depth:
notebook.zohopublic.in/public/notes/u3i1s033d318172e442b8b8f242767b93776c
Java: Annotation:
notebook.zohopublic.in/public/notes/u3i1sd9ea4e81ceef491cb4bd1ee221daa89f
Java: Singleton and Immutable Class:
notebook.zohopublic.in/public/notes/u3i1s340edd3a883b4ef7ac90874731c865b0
Java: Exception Handling
notebook.zohopublic.in/public/notes/u3i1se54e2f3438a84f42bec26cf3336a5226
Java: POJO and ENUM Class
notebook.zohopublic.in/public/notes/u3i1se962d56445eb4118ab4e4c0ca99e4728
Java: Operators
notebook.zohopublic.in/public/notes/u3i1s38886070c7a74e9db5b0ec3b1697f7f8
Java: Control flow statements
notebook.zohopublic.in/public/notes/u3i1sa26424f5a9614b35897900c90fb2c402
Nice 👍👍👍
One question on method overriding -
class B extends A -> A obj = new B(); Can you explain this type of object creation? and if we do obj.getEngine(); then whose method will be called?
B class engine will get called
Bro, can you make one video on deployment basically how to deploy microservice and web app and see logs.
Noted
Hey bro, can you please share these slides for notes?
Did you have notes? Please send the link if you have . Thank in Adv
Class is a blueprint/template/skeleton/stencil/mold by which we can create objects.
Right
lol. Dude no one gonna ask you what is class.
how to acheieve composition and aggregation in java . can you plz tell
In composition, if parent class dies, child class also dies.
while in aggregation, the relationship is more relaxed, and the objects can exist independently of each other.
Composition example:
-------------------------------------
class Car {
Engine engine = new Engine();
}
class Engine {
// Engine properties and methods
}
Aggregation example:
------------------------------------
class University {
List students;
public University(List students) {
this.students = students;
}
}
class Student {
// Student properties and methods
}
Notes link?
Can you make detailed video on aggregation association composition
sure
In polymorphism dynamic dispatch is missing. Anyways, great video simple & crisp.
Thanks and let me check buddy
Thats same as method overriding as which method to dispatch at runtime it is decided.
@@ayushkansal6161 Hi you took the membership plan, I just want to know how to deactivate the plan because it will automatically deduct the amount from my account.
Hi Shrayansh,
It would have been better if you could demostrate it on an IDE rather than drawing it on the ppt.
objects have state , behaviour and identity
please share the slides as well
It is mentioned in Procedural or Functional programming that reusability is not possible but we can call the function again and reuse. Right ?
Yes that is possible, but think from the capability which interface or abstract class provides, those kind of reusability is not there in functional programming
Hi Sheyansh I am premium member unable to find notes for videos please share any discord link available and notes download link
few initial videos notes are missing buddy
Sir can you share slides for notes and revision purposes. Thanks I just brought memebership for this playlist ❤❤
For most of the videos, in description section I have added notes link, for some missing ones, I will try to add
sir pls share notes of java sir, it will helop for me
Post core java...Please upload spring framework and spring boot as well
That's the plan buddy
@@ConceptandCoding so howmuch time will it take to complete the JAVA basics to avanced?
@@himanshukandpal5585 at this pace at least 1.5 - 2 years
Can i download these videos offline after join ?
I think youtube give download option
No download option is given by RUclips
can you also shared this ppt?
So buddy i haven't saved it
can we get the slides for this
did you get ?
can we please get the notes? Or do we get it if we become a paid member?
for some videos, notes are missing, even if you join as paid member.
@@ConceptandCoding Oh, what about this video? I couldn't find the slides, is it missing for this too?
@@justlc7 yea its missing
Can you please use hindi as a medium of communication ..I guess that will be more favourable for you to explain .
Sorry Ayumi, as many engineers are from South too, that's why i can not use Hindi, even if one engineer does not understand Hindi.
Hope you understand.
Object will have State and Behaviour.
commenting for better reach
Is this the same course in udemy?
yes
In this video, you have not covered coding example
Hi Adarsh, this is an introductory video, all these topics you will find in depth in further videos.
How many hrs is the whole playlist?
around 30hrs
@@ConceptandCoding Thanks for replying, can you tell me which videos are most imp for java interviews? I have one soon, last i worked on java was 3-4yrs back, so basically a noob now, just want to remember learn the imp videos for interview in a few days, can you help with this info? Thanks
Also is there a discord group you have? I think asking such questions will be seamless if any such exists.
Can you please share those handwritten notes and pdf used here ?
Hi Akhil, believe me, it would be really helpful for you, if you make your own notes after understanding.
It will benefit you in long term.
whoever is asking the question, are the real questions which asked by interviewer
yes
DAATA :P
Thanks for using English and not hindi
😂 you should learn hindi
Pls correctly pronounce the word data, it's not datha it is daeta
Noted, will improve it for sure
@@adityaagarwal2324 you got that what he said toh kyun ungli karni hai
@@adityakalwar267 arre sunne mae annoying lagta hn
communication mean one person understand what other person said ... you got it mean ok
Could You Please Provide these slides or notes
Hi, i thought engineers making their own notes after understanding will be much more beneficial then i share these.
That's one of the reason i refrain from sharing any notes buddy.