This is wat I m expecting ..from last 4 year I was not getting it ..everyone is just explaining theory part..you are explaining with practical examples ❤ loved it bro
@protonvashishtha7 жыл бұрын
Beautifully explained! Most people know what is abstraction and interfaces but don't know where to use which.
@SivaReddyJavaTechie7 жыл бұрын
Thanks Shwetank.
@StateofQuantumEntanglement7 жыл бұрын
great explanation..being mechanical engineering student, I was able to get the concept just by watching one time..thanks !!
@SivaReddyJavaTechie7 жыл бұрын
Thanks Venkatesh :)
@mahtabbeplab2480 Жыл бұрын
Thanks sir for adding these Realtime examples which helped me understand the differences in a neat manner.
@SivaReddyJavaTechie Жыл бұрын
Glad it was helpful!
@SimaanNassar5 жыл бұрын
Good Explanation , small note: in java 8 interface can have a default implantation , so you don't have to implement in sub classes if you provide the default behavior in the interface
@SivaReddyJavaTechie5 жыл бұрын
You are correct. I uploaded videos for Java 8 features.
@SivaReddyJavaTechie5 жыл бұрын
Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@harshadarahate36252 жыл бұрын
Thanks Siva sir for providing to the point explanation for difference between Interface and Abstract Class. It helped me a ton 🙏
@SivaReddyJavaTechie Жыл бұрын
You are most welcome
@ankitgiri68742 жыл бұрын
Video is nice, but dear sir at some points your tongue is sliping for wrong words. This is the best vdo about interface and abstraction, gone through many.
@aneesfatimashaikh97087 жыл бұрын
watched so many videos on this ..finaly understud ur video..very nice explanation thankiu so much sir
@rishabhagarwal34047 жыл бұрын
This is one of the most ask question by interviewer, and you cleared all my doubts. Thank you sir.
@SivaReddyJavaTechie7 жыл бұрын
Thanks Rishabh
@jibinjames51282 жыл бұрын
GREAT ONE , CRISP AND CLEAR
@jagadishs10864 жыл бұрын
Awesome explanation...sir you cleared all the doubts in interface and abstract in java.... thanks a lot sir
@SivaReddyJavaTechie4 жыл бұрын
Thanks. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy learning.
@earthcitizen71565 жыл бұрын
Hi siva sir 1)Plz explain the difference b/w abstract class vs interface of java 8 2)Difference b/w inteface of java 7 or below versions of java and intefaceas of java 8 interface?
@rajenderdasari53044 жыл бұрын
thanks for your clear cut information about the differences..
@SivaReddyJavaTechie4 жыл бұрын
Thanks Rajender. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@kgourav016 жыл бұрын
Good explanation but only one correction. Abstraction class can contain all the non abstract methods as well. It is not required to have abstract class atleast one abstract method for being it an abstract class. The main motive of abstract class is that it can't be instantiated.
@sandeshrana72255 жыл бұрын
Best explanation in KZbin
@SivaReddyJavaTechie5 жыл бұрын
Thanks Sandesh. Please refer our channel to your friends circle as it might be helpful for them. Happy Learning.
@hshimladka7 жыл бұрын
An abstract class is a class that is declared abstract-it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed.
@nimoa.rashid91866 жыл бұрын
Hrishikesh S thank you....may god bless you....bytheway I’m Muslim from EuroAsia...please don’t hate me🤪🤪🤪
@nagcvlogs6 жыл бұрын
Why would he hate ? he might be a Hindu and an Indian that doesn't mean he hates Muslim, We Indians may hate Pakistanis for creating issues in the countries ... Even we have a lot of Muslims in India and we treat them as our brothers and sisters ...HA HA I guess that's a lot of information Don't mind me ....I was Just saying...
@ALDMED39625 жыл бұрын
As far as I know an abstract class must include at least one abstract method
@dhanyamrajan4786 жыл бұрын
Great and simple explanation sir. Thank you. Only after watching this video i could understand both the concepts clearly.
@SivaReddyJavaTechie6 жыл бұрын
Thanks Dhanya. Please do suggest our channel to your friend circle as it might help them as well. Happy Learning.
@subramanianchenniappan40595 жыл бұрын
Thank you. I am an experienced java developer. This would be helpful for interviews
@SivaReddyJavaTechie5 жыл бұрын
Thanks Subramanian. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@subramanianchenniappan40595 жыл бұрын
@@SivaReddyJavaTechie sure
@peelygotdrip3 жыл бұрын
very good n detailed explanation. Thank you
@SivaReddyJavaTechie3 жыл бұрын
Thank you. Please share our youtube channel to your friends circle as it may be helpful for them. Happy Learning.
@IndellableHatesHandles Жыл бұрын
I don't know where an abstract class would be useful, but interfaces are very useful.
@gowthamisasanapuri99803 жыл бұрын
Very clear explanation... Thank you very much sir 😊.....
@keaweaquarian26312 жыл бұрын
Thank you, that was a great explanation.
@yasothaimani21196 жыл бұрын
Thank you so much I have lot of questions in interface here afterwards I don't have any doubts thank you
@SivaReddyJavaTechie5 жыл бұрын
Thanks Yosothai. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@ssrkgw46017 жыл бұрын
Very Nice Explanation and Effort -- Appreciate in coming forward in developing this video
@venkatsam24723 жыл бұрын
Simply superb bro.. please do more videos.. 👌🏻🙏🏻👍
@SivaReddyJavaTechie3 жыл бұрын
Thanks Venkat. Please share our KZbin channel to your friends circle as it may helpful for them. Happy Learning.
@venkatsam24723 жыл бұрын
@@SivaReddyJavaTechie sure bro
@kolluru176 жыл бұрын
Your explanation is very good and very clear.. thanks a lot
@SivaReddyJavaTechie6 жыл бұрын
Thanks Ravi. Please do suggest our channel to your friend circle as it might help them as well. Happy Learning.
@VasuRana3 жыл бұрын
You messed up a little in the end but I really liked your explaination. Liked. Thank you.
@parkashram64824 жыл бұрын
Thanks for such great content, can you please explain how we can hide implementation with the help of abstract class and interface.
@prateek15867 жыл бұрын
Very Simple and Useful explanation Thank you.
@sudeepduvvuru96257 жыл бұрын
Good Explanation.. Keep doing this kind of Videos. Thanx
@maneaniket42005 жыл бұрын
Crystal Clear Explanation
@SivaReddyJavaTechie5 жыл бұрын
Thanks Aniket. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@sandeepverma3377 жыл бұрын
Nice one. But you haven't told as per the Title of the topic "When to use abstract and when to use interface"
@RajuAhmed1116 жыл бұрын
When you don't know the implementation and perform common task to do for all use interface.
@prakashdolas44835 жыл бұрын
@@RajuAhmed111 same we can also achieve using abstract class by defining abstract methods only.except multiple inheritance support what is the other advantage of interface.
@Indian_working_mom5 жыл бұрын
@@RajuAhmed111 bro please tell me same that abstraction and interface in hospital management system
@marconarca27065 жыл бұрын
it is code reuseability bro
@SmartProgramming5 жыл бұрын
nice one sir, keep it up 👍👍👍🙂🙂🙂🙂
@tufanatha77984 жыл бұрын
Very clear explanation, Thank you !
@SivaReddyJavaTechie4 жыл бұрын
Thanks Tufan. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@tufanatha77984 жыл бұрын
@@SivaReddyJavaTechie Hi Sir, I have one question, is this possible to control a class to access only required methods of an Interface A, A is having test1 and test2 methods, Class B implements A, now I want B can access only test2. Is it possible? (in java 1.7 or 1.8)
@agarwalmohit437 жыл бұрын
Hi Siva, Thanks a lot. I was too confused about the abstract and interface, where to use what. This question was repeatedly asked by interviewer, and as result i was not able to answer appropriate logic behind each one. Regards, Mohit
@nimoa.rashid91866 жыл бұрын
You are a excellent teacher... Come to EuroAsia, Uzbekistan
@SivaReddyJavaTechie6 жыл бұрын
Thanks for your appreciation Aneyssa. Happy Learning.
@CapTonSumanth4 жыл бұрын
I got clear structure , thak you so much sir
@SivaReddyJavaTechie4 жыл бұрын
Thanks Sumanth. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@tmzpanda4 жыл бұрын
0:29 abstract class 1:34 partial abstraction and code reusability 3:05 bank example 7:43 no instantiation 8:33 interface 12:55 abstraction 14:07 difference: abstract class extensibility vs interface multi-inheritance
@naveenp84386 жыл бұрын
Nice Reddy. An abstract class is partially implementation. An abstract class may or may not abstract method.
@SivaReddyJavaTechie6 жыл бұрын
Thanks Naveen.
@sumitpaul30805 жыл бұрын
Respect and Lots of thanks for this kind of quality explanation with the code.. May God bless you.
@SivaReddyJavaTechie5 жыл бұрын
Thanks Submit. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@apoorv_sri9 ай бұрын
can uou please also explain , whats the use case of abstract classes after java 8 new interfaces features
@rahulchandrabhan5 жыл бұрын
Very easily explained. Good Job
@SivaReddyJavaTechie5 жыл бұрын
Thanks Rahul. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@rahulchandrabhan5 жыл бұрын
@@SivaReddyJavaTechie will do brother... 😄
@shivamkumar-qs7er5 жыл бұрын
Greatest videos ever on abstract !
@SivaReddyJavaTechie5 жыл бұрын
Thanks Shivam. Please refer our KZbin channel to your friends circle as it might be helpful. Happy Learning.
@sneharane25964 жыл бұрын
Thank you sir, you really explained it really well and made my doubts clear!
@SivaReddyJavaTechie4 жыл бұрын
Thank you Sneha. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@korlamskrishna7 жыл бұрын
Nice info.. one thing we are missing here... if we create object for child class say for ex hdfc and calling methods we are loosing polymarphsim here
@SivaReddyJavaTechie7 жыл бұрын
Siva - This is called as runtime polymarphism where you have same method signature in both super class and sub class but at runtime sub class method overrides the super class method.
@yanlingyang2567 жыл бұрын
the most detailed and easy-understanding explanation!!!! Thx a lot :)
@SivaReddyJavaTechie7 жыл бұрын
Thanks Yanling
@avatargirase7 жыл бұрын
By looking at the method in your classes the class name and the subclass name should be like Account, SavingAccount,CheckingAccount......
@madhujitbhattacharjee10876 жыл бұрын
Nice and simple explanation. Thanks Mr. Reddy!
@shamshersingh14297 жыл бұрын
very nice explaination shiva....simply awesome....thanks
@sweetthirty2 Жыл бұрын
Hi sir Why do we use an interface and not an abstract class? What if I implement the same method in an interface and abstract then? Any difference? recent interview question asked
@rajkumarp77848 жыл бұрын
u explained both concepts with sane example.but i didnt understand when to choose interface and when to choose abstract. can u pls give some real time scenarios
@SivaReddyJavaTechie8 жыл бұрын
Interface provides 100% abstraction in Java. Interface is used to provide as a contract for the implementations. In a system it is possible to have the multiple class having the same method name but implementation might be changed from one sub class to another sub class when you providing the functionality for the methods. Hence using the interface, you provide as a contract for the business. E.g: in the case of JDBC, java provides Statement as interface and it have below methods. 1) public ResultSet executeQuery(String sql) 2) public int executeUpdate(String sql) 3) public boolean execute(String sql) 4) public int[] executeBatch() For Java, it does not matter for which database it has to execute the queries as long as database vendor provides the functionality for the above methods. Also each database(oracle, DB2, mysql) can have their own implementation for executing the queries. Abstract class : Go for abstract class when all sub classes methods having the same functionality of the super class method then it is better you can provides those common methods in the abstract class and which you feel implementation is differ in sub classes declare them as abstract methods so that sub classes can only provide implementation for the abstract methods and other methods can be used as code resuable
@srikanthreddy69915 жыл бұрын
Finally clear explanation thanks
@SivaReddyJavaTechie5 жыл бұрын
Thanks Srikanth Reddy. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@srikanthreddy69915 жыл бұрын
@@SivaReddyJavaTechie definitely
@adityaratra72906 жыл бұрын
Thanks sir for brushing up the concepts
@SivaReddyJavaTechie6 жыл бұрын
Thanks Aditya. Please refer our channel to your friends circle as it might be helpful for them. Happy Learning.
@alishachaudhary48546 жыл бұрын
literally one of the best explained video!
@SivaReddyJavaTechie5 жыл бұрын
Thanks Alisha. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning
@yadneshkhode30915 жыл бұрын
Outstanding explanation!!!!! Loved it
@SivaReddyJavaTechie5 жыл бұрын
Thank you Yadnesh. Please refer our channel to your friends circle as it might be helpful for them. Happy Learning.
@pallavianilkar972 Жыл бұрын
Nice explanation
@pcpardon5 жыл бұрын
Thank you. Answers for long waited questions I had
@SivaReddyJavaTechie5 жыл бұрын
Thanks Kasun. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@devireddyfavreddy47856 жыл бұрын
Very clear explanation, thanks bro
@SivaReddyJavaTechie6 жыл бұрын
Thank you DeviReddy. Please refer our channel to your friends circle as it might helpful for them. Happy Learning.
@saurabhdhabe6036 жыл бұрын
Thanks a lot! Great explanation with an example and the simple words. Easy to understand.
@SivaReddyJavaTechie6 жыл бұрын
+Saurabh Dhabe - Thanks Saurabh.
@harikagoud76524 жыл бұрын
such a great explanation!! It was damn clear and i am highly impressed. Thanks a ton :-)
@SivaReddyJavaTechie4 жыл бұрын
Thanks Harika. Please refer our KZbin channel to your friends and colleagues as it might be helpful for them. Happy learning.
@marizalobo56346 жыл бұрын
Very good explanation. Thank you sir
@SivaReddyJavaTechie5 жыл бұрын
Thanks Mariza. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@YADA700735 жыл бұрын
Great Video and great explanation. But I have a question, Can abstract class inherits from other class?
@SivaReddyJavaTechie5 жыл бұрын
Yes, and you cannot instantiate it either, of course. If you extend a class with an abstract class and not define or provide the implementation for the base class abstract methods then the child class extending it would automatically become abstract.
@SivaReddyJavaTechie5 жыл бұрын
Please refer our channel to your friends circle as it might be helpful for them. Happy Learning.
@shubhamshah35419 ай бұрын
abstract class conatin all the methods as concrete also, there is no rule like you need to mention atleast 1 abstract method as you mention @Siva Reddy
@muradivenki4 жыл бұрын
Awesome explanation. Thank you so much. it helps me a lot in the interview.
@SivaReddyJavaTechie4 жыл бұрын
Thanks Venkatesh. Please refer our KZbin channel to your friends and colleagues as it might be helpful for them. Happy Learning.
@hashinitamilkolam59597 жыл бұрын
Hi Siva Reddy , Good explanation .... I have one doubt , at last in that AbstractClassDemo.java program had one error i couldn't find that error please explain me . because i'm not that much familiar in java . error : 20th line "Private int amount = 0;"
@sandeepmankena3637 жыл бұрын
shasudha sudha where is that line?
@ravurisandeep83775 жыл бұрын
Save the file after writing that statement..
@indraverma28113 жыл бұрын
Very Nice!!!
@SivaReddyJavaTechie3 жыл бұрын
Thanks Indra. Please share our KZbin channel to your friends circle as it may be helpful for them. Happy learning.
@gopireddysoundarya76174 жыл бұрын
Clear explanation thankyou..
@SivaReddyJavaTechie4 жыл бұрын
Thanks Soundarya. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@saktiranjanbehera70105 жыл бұрын
Thanks for sharing the example.Ty again Sir
@SivaReddyJavaTechie5 жыл бұрын
Thanks Sakti Ranjan Behera. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@shivramshrestha38777 жыл бұрын
Nice video sir, I really understood about the abstract and interface
@SivaReddyJavaTechie7 жыл бұрын
Thanks ShivRam.
@krushnasahu286 жыл бұрын
Thanks for this video easy to understood can u upload all oops concept
@SivaReddyJavaTechie6 жыл бұрын
Thanks Krushna Sahu. Please go through videos uploaded here. @kzbin.info/www/bejne/nae7faOwdtKgnJo
@AnthonyRamtulla5 жыл бұрын
This was very clear -- great job.
@yoapps1375 жыл бұрын
It would also be nice to give us examples in day to day coding life... eg. like... OnClickListeners are an Interface. What about an example like that with Abstract class.
@rahuldash60233 жыл бұрын
Nice explanation which leads to clearly understand the difference between abstract class and interface
@AdityaSingh-qn7rf Жыл бұрын
still not clear when interface comes with default method in java 8 then what is the use of abstract class ?
@mdalimiyan6 жыл бұрын
Good one Sir. Very useful. I can it is Amazing.
@SivaReddyJavaTechie5 жыл бұрын
Thanks Srkfan. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@Anand-wi4yb6 жыл бұрын
I wish you were my Advanced Programming instructor!
@SivaReddyJavaTechie6 жыл бұрын
Thanks Anand.
@SudershanRavi6 жыл бұрын
good explanation Siva
@SivaReddyJavaTechie6 жыл бұрын
Thanks Ravi.
@kalyanchakravarthy60986 жыл бұрын
Great explanation sir,
@SivaReddyJavaTechie6 жыл бұрын
Thanks Kalyan.
@kalyanchakravarthy60986 жыл бұрын
Sir, i would be greatful if you upload the videos of Inheritance and static class of real time example
@suryasingh48175 жыл бұрын
I thought you will give us insight when to use what? It's certainly not the case that if my all method is abstract, I should be switching to interface. Interface and abstract class have much more difference and power in term of when to use and how. If all methods need implementation, I can create abstract class with all abstract method. Then why Interface is required at all.
@grandhegopichand43745 жыл бұрын
If you do like this, you have only one e sub class .. If you go for interface you can implement multiple sub class , and java don't support multiple inheritance...so we are going to. Interfaces
@prashikawachar93585 жыл бұрын
thank you sir I understood all concepts.
@SivaReddyJavaTechie5 жыл бұрын
Thanks Prashik. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@ashishkhamkar33396 жыл бұрын
Nice explanation with example !!!
@SivaReddyJavaTechie6 жыл бұрын
Thanks Ashish.
@MrShashidharhegde5 жыл бұрын
Great video
@SivaReddyJavaTechie5 жыл бұрын
Thanks Shashidhar. Please refer our channel to your friend circle as it might be helpful for them. Happy Learning.
@mohaniavlogs5 жыл бұрын
Please tell, What is the difference between 100% abstract class and interface?
@siagaur84836 жыл бұрын
Explanation is good
@SivaReddyJavaTechie6 жыл бұрын
Thanks Sia Gaur.
@ronjonbanerjee17605 жыл бұрын
very nice ..thanks
@SivaReddyJavaTechie5 жыл бұрын
Thanks Ronjon. Please refer our channel to your friends as it might helpful for them. Happy Learning.
@JayTailor456 жыл бұрын
Thank you so much... It clear my all doubts about abstract class
@SivaReddyJavaTechie6 жыл бұрын
Thanks Jay.
@nehapatel82126 жыл бұрын
cleared all the points thank u sir
@SivaReddyJavaTechie6 жыл бұрын
Thanks Neha. Please refer our channel to your friends circle. Thank you.
@ravurisandeep83775 жыл бұрын
can I change the body of concrete method of abstract clss while overriding it in child clss..answer me pls?
@SivaReddyJavaTechie5 жыл бұрын
Yes, you can.
@ijazahmad-hh2zk6 жыл бұрын
excellent nice explaination
@SivaReddyJavaTechie6 жыл бұрын
Thanks Ijaz. Please do refer our channel to your friends circle as it might be helpful for them. Happy Learning.
@VijayKumarUppala5 жыл бұрын
There is no need to have atleast one abstract method in an abstract class. But if one of the methods are abstract then the class must be an abstract class. Please confuse the viewers with wrong definitions.
@RamaKrishna-so9nz6 жыл бұрын
well explanation with examples
@SivaReddyJavaTechie6 жыл бұрын
Thanks Rama Krishna.
@suvasishsahoo21897 жыл бұрын
Great explanation!
@SivaReddyJavaTechie7 жыл бұрын
Thanks Suvasish.
@Tony.Nguyen1373 жыл бұрын
Hi bro my english is not so good. Can you type here in the comment the answer to question 4? When to you use abstract class and Interface?
@HameedRiswan5 жыл бұрын
In abstract class u used public abstract int...is string,float also it acceptable....what is the use of int!
@old43127 жыл бұрын
Nice explanation...
@SivaReddyJavaTechie7 жыл бұрын
Thanks Sagar :)
@prakashkumarbehera8456 жыл бұрын
So NYC explanation...Ty
@SivaReddyJavaTechie5 жыл бұрын
Thanks Prakash. Please refer our KZbin channel to your friends circle as it might be helpful for them. Happy Learning.
@vinaysaivarma47538 жыл бұрын
you said no need to implement concrete method in while inheriting abstract class then y do u override getadrress method ....then overided method is executed in the output ???aaa chepandi
@SivaReddyJavaTechie7 жыл бұрын
Here is the scenario : If you don't want super class implementation getaddress method in sub class, you can override and get what ever the functionality you want in the subclass method getaddress method. this is based on the requirement, as long as you are happy with the concrete method implementation in super class can be used as it is then no need to override else you have to override it. Hope it is clear now.
@dileepkeeppalli11476 жыл бұрын
Well explained!!!!!! Thanks a lot!!!!
@SivaReddyJavaTechie6 жыл бұрын
Thanks Dileep. Please do suggest our youtube channel to your friend circle as it might be help them as well. Happy Learning.
@dileepkeeppalli11476 жыл бұрын
Siva Reddy sure.. I will do..
@bijennaorem76477 жыл бұрын
Great One
@SivaReddyJavaTechie7 жыл бұрын
Thanks Bijen.
@sharefun57996 жыл бұрын
I've seen people using both of them together but din't get this why .i.e subclass inherit abstract class and implements an interface as well . If we can create mandatory methods in abstract class already then why using interface for creating mandatory methods for subclasses? Like we created calculateInterest in abstract class so that it should be mandatory for all subclasses then why we used interface to create other methods , They can be created as abstract methods in abstract classes ? So what is the actual purpose of using them together ?
@SivaReddyJavaTechie6 жыл бұрын
Use Interface - When all the subclasses want to implement their own implementation for all the methods defined in Interface. Use Abstract class - When there is common methods that can be extends to as it is. This will help code reusable and if any sub class want its own implementation then , sub class can override those methods