When to use Abstract class and When to use Interface in Java

Sdílet
Vložit
  • čas přidán 30. 07. 2024
  • Please check out my blog(learnsimple.in) for more technical videos.
    For any java/devops/developer/lead position related mock interview assistance/Guidance/ support, you can reach out me @ sivajavatechie5@gmail.com
    In this session, I explained java interview questions and answers on abstract class , Interface with examples.
    By end of this session, You will be able to answers to below questions:
    What is abstract class?
    What is interface?
    What is the use of abstract class and interface?
    When to use Abstract class and when to use interface?
    What is the difference between abstract class vs interface?

Komentáře • 277

  • @ssrkgw4601
    @ssrkgw4601 Před 7 lety +4

    Very Nice Explanation and Effort -- Appreciate in coming forward in developing this video

  • @yogeesh8637
    @yogeesh8637 Před 23 dny

    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

  • @sudeepduvvuru9625
    @sudeepduvvuru9625 Před 7 lety +5

    Good Explanation.. Keep doing this kind of Videos. Thanx

  • @StateofQuantumEntanglement

    great explanation..being mechanical engineering student, I was able to get the concept just by watching one time..thanks !!

  • @shamshersingh1429
    @shamshersingh1429 Před 7 lety +2

    very nice explaination shiva....simply awesome....thanks

  • @rishabhagarwal3404
    @rishabhagarwal3404 Před 6 lety

    This is one of the most ask question by interviewer, and you cleared all my doubts. Thank you sir.

  • @yasothaimani2119
    @yasothaimani2119 Před 5 lety +2

    Thank you so much I have lot of questions in interface here afterwards I don't have any doubts thank you

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety

      Thanks Yosothai. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

  • @madhujitbhattacharjee1087

    Nice and simple explanation. Thanks Mr. Reddy!

  • @prateek1586
    @prateek1586 Před 7 lety +1

    Very Simple and Useful explanation
    Thank you.

  • @dhanyamrajan478
    @dhanyamrajan478 Před 6 lety

    Great and simple explanation sir. Thank you. Only after watching this video i could understand both the concepts clearly.

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 6 lety

      Thanks Dhanya. Please do suggest our channel to your friend circle as it might help them as well. Happy Learning.

  • @AnthonyRamtulla
    @AnthonyRamtulla Před 5 lety

    This was very clear -- great job.

  • @parkashram6482
    @parkashram6482 Před 4 lety +1

    Thanks for such great content, can you please explain how we can hide implementation with the help of abstract class and interface.

  • @protonvashishtha
    @protonvashishtha Před 6 lety

    Beautifully explained! Most people know what is abstraction and interfaces but don't know where to use which.

  • @saurabhdhabe603
    @saurabhdhabe603 Před 6 lety

    Thanks a lot!
    Great explanation with an example and the simple words.
    Easy to understand.

  • @sneharane2596
    @sneharane2596 Před 4 lety +1

    Thank you sir, you really explained it really well and made my doubts clear!

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 4 lety

      Thank you Sneha. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

  • @sumitpaul3080
    @sumitpaul3080 Před 4 lety

    Respect and Lots of thanks for this kind of quality explanation with the code.. May God bless you.

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 4 lety

      Thanks Submit. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

  • @yanlingyang256
    @yanlingyang256 Před 6 lety

    the most detailed and easy-understanding explanation!!!! Thx a lot :)

  • @earthcitizen7156
    @earthcitizen7156 Před 4 lety

    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?

  • @muradivenki
    @muradivenki Před 4 lety

    Awesome explanation. Thank you so much. it helps me a lot in the interview.

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 4 lety

      Thanks Venkatesh. Please refer our CZcams channel to your friends and colleagues as it might be helpful for them. Happy Learning.

  • @emailsubraja
    @emailsubraja Před 6 lety

    Is the getadress () method an abstract method since it doesn't have definition.

  • @TeluguInshots12345
    @TeluguInshots12345 Před 7 lety +2

    tanq sir,nice explanation

  • @JayTailor45
    @JayTailor45 Před 6 lety

    Thank you so much... It clear my all doubts about abstract class

  • @harshadarahate3625
    @harshadarahate3625 Před 2 lety +1

    Thanks Siva sir for providing to the point explanation for difference between Interface and Abstract Class. It helped me a ton 🙏

  • @harikagoud7652
    @harikagoud7652 Před 3 lety +2

    such a great explanation!! It was damn clear and i am highly impressed. Thanks a ton :-)

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 3 lety

      Thanks Harika. Please refer our CZcams channel to your friends and colleagues as it might be helpful for them. Happy learning.

  • @SmartProgramming
    @SmartProgramming Před 5 lety +2

    nice one sir, keep it up 👍👍👍🙂🙂🙂🙂

  • @mahtabbeplab2480
    @mahtabbeplab2480 Před rokem +1

    Thanks sir for adding these Realtime examples which helped me understand the differences in a neat manner.

  • @jagadishs1086
    @jagadishs1086 Před 4 lety

    Awesome explanation...sir you cleared all the doubts in interface and abstract in java.... thanks a lot sir

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 4 lety +1

      Thanks. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy learning.

  • @pcpardon
    @pcpardon Před 5 lety +1

    Thank you. Answers for long waited questions I had

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety

      Thanks Kasun. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

  • @alishachaudhary4854
    @alishachaudhary4854 Před 5 lety

    literally one of the best explained video!

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety

      Thanks Alisha. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning

  • @avatargirase
    @avatargirase Před 7 lety

    By looking at the method in your classes the class name and the subclass name should be like Account, SavingAccount,CheckingAccount......

  • @kgourav01
    @kgourav01 Před 6 lety

    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.

  • @ComedyInfoC
    @ComedyInfoC Před 5 lety +1

    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

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety +1

      You are correct. I uploaded videos for Java 8 features.

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety

      Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

  • @HameedRiswan
    @HameedRiswan Před 5 lety

    In abstract class u used public abstract int...is string,float also it acceptable....what is the use of int!

  • @hshimladka
    @hshimladka Před 7 lety +19

    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.rashid9186
      @nimoa.rashid9186 Před 6 lety

      Hrishikesh S thank you....may god bless you....bytheway I’m Muslim from EuroAsia...please don’t hate me🤪🤪🤪

    • @nagcvlogs
      @nagcvlogs Před 6 lety +3

      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...

    • @ALDMED3962
      @ALDMED3962 Před 5 lety +1

      As far as I know an abstract class must include at least one abstract method

  • @AdityaSingh-qn7rf
    @AdityaSingh-qn7rf Před rokem

    still not clear when interface comes with default method in java 8 then what is the use of abstract class ?

  • @shivramshrestha3877
    @shivramshrestha3877 Před 7 lety

    Nice video sir, I really understood about the abstract and interface

  • @jibinjames5128
    @jibinjames5128 Před 2 lety +1

    GREAT ONE , CRISP AND CLEAR

  • @yadneshkhode3091
    @yadneshkhode3091 Před 5 lety

    Outstanding explanation!!!!! Loved it

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety

      Thank you Yadnesh. Please refer our channel to your friends circle as it might be helpful for them. Happy Learning.

  • @sweetthirty2
    @sweetthirty2 Před rokem

    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

  • @gowthamisasanapuri9980

    Very clear explanation... Thank you very much sir 😊.....

  • @kolluru17
    @kolluru17 Před 6 lety

    Your explanation is very good and very clear.. thanks a lot

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 6 lety

      Thanks Ravi. Please do suggest our channel to your friend circle as it might help them as well. Happy Learning.

  • @agarwalmohit43
    @agarwalmohit43 Před 7 lety

    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

  • @yoapps137
    @yoapps137 Před 5 lety

    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.

  • @jameslemieux8973
    @jameslemieux8973 Před 5 lety +2

    very helpful thank you!

  • @ankitgiri6874
    @ankitgiri6874 Před 2 lety +1

    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.

  • @shivamkumar-qs7er
    @shivamkumar-qs7er Před 5 lety

    Greatest videos ever on abstract !

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety

      Thanks Shivam. Please refer our CZcams channel to your friends circle as it might be helpful. Happy Learning.

  • @keaweaquarian2631
    @keaweaquarian2631 Před 2 lety +1

    Thank you, that was a great explanation.

  • @vinaysaivarma4753
    @vinaysaivarma4753 Před 7 lety

    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

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 7 lety

      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.

  • @s260888
    @s260888 Před 7 lety

    Thanks for info....

  • @rajenderdasari5304
    @rajenderdasari5304 Před 4 lety +1

    thanks for your clear cut information about the differences..

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 4 lety

      Thanks Rajender. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

  • @hashinitamilkolam5959
    @hashinitamilkolam5959 Před 7 lety +4

    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;"

  • @Indian_working_mom
    @Indian_working_mom Před 5 lety

    sir please explain same abstraction and interface in hospital management if knows any one please tell me

  • @saktiranjanbehera7010
    @saktiranjanbehera7010 Před 5 lety

    Thanks for sharing the example.Ty again Sir

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety

      Thanks Sakti Ranjan Behera. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

  • @sandeshrana7225
    @sandeshrana7225 Před 5 lety +1

    Best explanation in CZcams

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety

      Thanks Sandesh. Please refer our channel to your friends circle as it might be helpful for them. Happy Learning.

  • @adityaratra7290
    @adityaratra7290 Před 5 lety

    Thanks sir for brushing up the concepts

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety +1

      Thanks Aditya. Please refer our channel to your friends circle as it might be helpful for them. Happy Learning.

  • @mdalimiyan
    @mdalimiyan Před 5 lety

    Good one Sir. Very useful. I can it is Amazing.

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety

      Thanks Srkfan. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

  • @prashikawachar9358
    @prashikawachar9358 Před 4 lety

    thank you sir I understood all concepts.

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 4 lety

      Thanks Prashik. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

  • @devireddyfavreddy4785
    @devireddyfavreddy4785 Před 5 lety

    Very clear explanation, thanks bro

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety

      Thank you DeviReddy. Please refer our channel to your friends circle as it might helpful for them. Happy Learning.

  • @peelygotdrip
    @peelygotdrip Před 3 lety +1

    very good n detailed explanation. Thank you

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 3 lety

      Thank you. Please share our youtube channel to your friends circle as it may be helpful for them. Happy Learning.

  • @salaheddinemakkaoui7970

    thank you very much it's very helpful

  • @perumalsamy5346
    @perumalsamy5346 Před 6 lety

    Excellent. Good effort. Thanks lot..

  • @Ravikumar-gj6qw
    @Ravikumar-gj6qw Před 6 lety

    Good explanation Sir tq so much

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 6 lety

      Thanks Ravi. Please refer our channel to your friend circle.Have a Great Day.

  • @tmzpanda
    @tmzpanda Před 4 lety +3

    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

  • @mohaniavlogs
    @mohaniavlogs Před 5 lety

    Please tell, What is the difference between 100% abstract class and interface?

  • @krushnasahu28
    @krushnasahu28 Před 6 lety

    Thanks for this video easy to understood can u upload all oops concept

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 6 lety

      Thanks Krushna Sahu. Please go through videos uploaded here. @czcams.com/video/gvXLpzAmmf8/video.html

  • @marizalobo5634
    @marizalobo5634 Před 6 lety

    Very good explanation. Thank you sir

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety

      Thanks Mariza. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

  • @ravurisandeep8377
    @ravurisandeep8377 Před 4 lety

    can I change the body of concrete method of abstract clss while overriding it in child clss..answer me pls?

  • @CapTonSumanth
    @CapTonSumanth Před 4 lety +1

    I got clear structure , thak you so much sir

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 4 lety

      Thanks Sumanth. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

  • @nehapatel8212
    @nehapatel8212 Před 6 lety

    cleared all the points thank u sir

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 6 lety

      Thanks Neha. Please refer our channel to your friends circle. Thank you.

  • @bhargavi3884
    @bhargavi3884 Před 5 lety

    If I want provide implementation for only one method from interface to class. How I can done this

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety

      You can do it through functional interface in Java. Please refer video czcams.com/video/ZRolf_JLM28/video.html

  • @apoorv_sri
    @apoorv_sri Před 5 měsíci

    can uou please also explain , whats the use case of abstract classes after java 8 new interfaces features

  • @tufanatha7798
    @tufanatha7798 Před 4 lety +2

    Very clear explanation, Thank you !

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 4 lety +1

      Thanks Tufan. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

    • @tufanatha7798
      @tufanatha7798 Před 4 lety

      @@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)

  • @maneaniket4200
    @maneaniket4200 Před 4 lety

    Crystal Clear Explanation

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 4 lety

      Thanks Aniket. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

  • @rahulchandrabhan
    @rahulchandrabhan Před 5 lety +1

    Very easily explained. Good Job

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety +1

      Thanks Rahul. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

    • @rahulchandrabhan
      @rahulchandrabhan Před 5 lety +1

      @@SivaReddyJavaTechie will do brother... 😄

  • @VijayKumarUppala
    @VijayKumarUppala Před 5 lety +1

    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.

  • @ashishkhamkar3339
    @ashishkhamkar3339 Před 6 lety

    Nice explanation with example !!!

  • @suvasishsahoo2189
    @suvasishsahoo2189 Před 6 lety

    Great explanation!

  • @sharefun5799
    @sharefun5799 Před 6 lety

    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 ?

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 6 lety +1

      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

  • @subramanianchenniappan4059

    Thank you. I am an experienced java developer. This would be helpful for interviews

  • @muralinaidu1059
    @muralinaidu1059 Před 7 lety +2

    Like it.

  • @prakashkumarbehera845
    @prakashkumarbehera845 Před 6 lety

    So NYC explanation...Ty

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety

      Thanks Prakash. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

  • @JointFamily93
    @JointFamily93 Před 6 lety

    why we need to have interface to only declare methods , we can simply specify the needed method in e ach class right, why we need to define it somewhere as interface

    • @rajeshj8834
      @rajeshj8834 Před 6 lety

      1. It Gives a Structure to the entire coding .
      2. It helps to maintain coding standard and that too compiler enforced
      3.Very hypothetically - It is like an index of the book by seeing the interface you can come to know what is available easily.

  • @pallavianilkar972
    @pallavianilkar972 Před rokem

    Nice explanation

  • @user-bq6iw1rd6y
    @user-bq6iw1rd6y Před 6 lety +2

    14:12 abstract vs interface rundown

  • @venkatsam2472
    @venkatsam2472 Před 3 lety +1

    Simply superb bro.. please do more videos.. 👌🏻🙏🏻👍

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 3 lety +1

      Thanks Venkat. Please share our CZcams channel to your friends circle as it may helpful for them. Happy Learning.

    • @venkatsam2472
      @venkatsam2472 Před 3 lety +1

      @@SivaReddyJavaTechie sure bro

  • @gopireddysoundarya7617

    Clear explanation thankyou..

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 4 lety

      Thanks Soundarya. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

  • @nishathparveen3902
    @nishathparveen3902 Před 6 lety

    sir video is not visible visible properly

  • @RamaKrishna-so9nz
    @RamaKrishna-so9nz Před 6 lety

    well explanation with examples

  • @korlamskrishna
    @korlamskrishna Před 7 lety

    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

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 7 lety

      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.

  • @rajkumarp7784
    @rajkumarp7784 Před 7 lety

    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

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 7 lety +2

      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

  • @dileepkeeppalli1147
    @dileepkeeppalli1147 Před 6 lety

    Well explained!!!!!! Thanks a lot!!!!

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 6 lety +1

      Thanks Dileep. Please do suggest our youtube channel to your friend circle as it might be help them as well. Happy Learning.

    • @dileepkeeppalli1147
      @dileepkeeppalli1147 Před 6 lety

      Siva Reddy sure.. I will do..

  • @old4312
    @old4312 Před 7 lety

    Nice explanation...

  • @srikanthreddy6991
    @srikanthreddy6991 Před 5 lety

    Finally clear explanation thanks

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety

      Thanks Srikanth Reddy. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

    • @srikanthreddy6991
      @srikanthreddy6991 Před 5 lety +1

      @@SivaReddyJavaTechie definitely

  • @nimoa.rashid9186
    @nimoa.rashid9186 Před 6 lety +1

    You are a excellent teacher... Come to EuroAsia, Uzbekistan

  • @sandeepverma337
    @sandeepverma337 Před 6 lety +17

    Nice one. But you haven't told as per the Title of the topic "When to use abstract and when to use interface"

    • @RajuAhmed111
      @RajuAhmed111 Před 6 lety +1

      When you don't know the implementation and perform common task to do for all use interface.

    • @prakashdolas4483
      @prakashdolas4483 Před 5 lety

      @@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_mom
      @Indian_working_mom Před 5 lety

      @@RajuAhmed111 bro please tell me same that abstraction and interface in hospital management system

    • @marconarca2706
      @marconarca2706 Před 4 lety

      it is code reuseability bro

  • @siagaur8483
    @siagaur8483 Před 5 lety

    Explanation is good

  • @pubgmoments1584
    @pubgmoments1584 Před 4 lety

    Thanks sir ..u r great

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 4 lety

      Thanks Gamer Romin. Please refer our CZcams channel to your friends circle as it might be helpful for them. Happy Learning.

  • @SonuSharma-kz9kg
    @SonuSharma-kz9kg Před 7 lety

    what is purpose constructor in abstract class but can't create object in abstract class

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 7 lety +1

      When you create constructor in abstract class, it is the responsibility of sub class which extends the abstract class has to create object for abstract class. So when you create constructor in abstract class, sub class has to pass the parameters to abstract class constructor. If you want initialise some properties from sub class to abstract class, you can use constructor in abstract class.

  • @MrShashidharhegde
    @MrShashidharhegde Před 5 lety

    Great video

    • @SivaReddyJavaTechie
      @SivaReddyJavaTechie  Před 5 lety

      Thanks Shashidhar. Please refer our channel to your friend circle as it might be helpful for them. Happy Learning.

  • @rampage241
    @rampage241 Před 6 lety

    good explanation!