Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Java Interface and Abstract Class?
I am a student in Java, and I am trying to understand the concepts of an Interface and an Abstract Class.
Everywhere I try to read about them, even my textbook, I can't quite understand WHEN you would use them. I have seen a few examples of an Interface - isn't it just a class that includes the shells of methods with no actual commands in them? If that is the case, doesn't that would mean you would never actually NEED to use an Interface?
I also understand an Interface cannot be instantiated, it must be implemented - but what does implementing an interface do?
0 · ·