tag:blogger.com,1999:blog-7955003209126272036.post3532254279925440820..comments2024-02-23T23:16:22.861+05:30Comments on Geek Explains: Java, J2EE, Oracle, Puzzles, and Problem Solving!: Difference between Interfaces and Abstract ClassesGeekhttp://www.blogger.com/profile/00648920090539126396noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-7955003209126272036.post-540567435416851722013-01-02T19:31:47.684+05:302013-01-02T19:31:47.684+05:30Another difference I would like to add is that whi...Another difference I would like to add is that while abstract classes allow constructors to be added, interfaces don't allow constructors.<br />See:<br /><a href="http://www.javaexperience.com/exhaustive-differences-between-abstract-class-and-interface/" rel="nofollow">Abstract class and interface</a>Java Experiencehttp://www.javaexperience.comnoreply@blogger.comtag:blogger.com,1999:blog-7955003209126272036.post-13426071530886958472012-10-25T05:03:08.806+05:302012-10-25T05:03:08.806+05:30Thanks so much Geek! This article helped me under...Thanks so much Geek! This article helped me understand this concept much better and this one helped as well: <a href="http://www.programmerinterview.com/index.php/java-questions/interface-vs-abstract-class/" rel="nofollow">Interface vs Abstract class</a>Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7955003209126272036.post-69198534435228962972012-10-25T05:02:48.720+05:302012-10-25T05:02:48.720+05:30Thanks so much Geek! This article helped me under...Thanks so much Geek! This article helped me understand this concept much better and this one helped as well: <a href="http://www.programmerinterview.com/index.php/java-questions/interface-vs-abstract-class/" rel="nofollow">Interface vs Abstract class</a>Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7955003209126272036.post-74347635367967321102012-09-15T21:12:28.236+05:302012-09-15T21:12:28.236+05:30Another difference between abstract class and inte...Another <a href="http://java67.blogspot.sg/2012/09/what-is-difference-between-interface-abstract-class-java.html" rel="nofollow">difference between abstract class and interface in Java</a> is that abstract class are slightly faster than interface in Java because of search and call is involve with interface method. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7955003209126272036.post-49931458203313243712011-10-31T16:30:45.167+05:302011-10-31T16:30:45.167+05:30Good one.nice explanationGood one.nice explanationpriyankanoreply@blogger.comtag:blogger.com,1999:blog-7955003209126272036.post-27175640536112259472011-10-31T16:29:25.508+05:302011-10-31T16:29:25.508+05:30Good one.Nice explanationGood one.Nice explanationpriyankahttps://www.blogger.com/profile/11907999454581403068noreply@blogger.comtag:blogger.com,1999:blog-7955003209126272036.post-30351760459738445612008-06-25T21:02:00.000+05:302008-06-25T21:02:00.000+05:30Hello geek, I've read your article. Thank you for ...Hello geek, <BR/><BR/>I've read your article. Thank you for explaining that issue in such a detail. I really didn't know that. I've always thought that interfaces inherit from Object as well. I'm still sure that I read about that somewhere, but now I'm also pretty much sure that it was just incorrect. And now that you mentioned it... I've never really noticed that I don't have a clone() or Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7955003209126272036.post-37083079666589594982008-06-25T14:54:00.000+05:302008-06-25T14:54:00.000+05:30Thanks Martin for being so active. You brought up ...Thanks <B>Martin</B> for being so active. You brought up an excellent point and I hope it'll help all of us in some way or the other.<BR/><BR/>I still re-iterate the same thing that Interfaces don't really inherit the Object class. They are actually implemented in a different way altogether to facilitate access to the Object methods (only public instance methods). <BR/><BR/>The Java Language Geekhttps://www.blogger.com/profile/00648920090539126396noreply@blogger.comtag:blogger.com,1999:blog-7955003209126272036.post-23787109309898775102008-06-25T02:09:00.000+05:302008-06-25T02:09:00.000+05:30Hey geek, I understand what you're saying, but I'm...Hey geek, I understand what you're saying, but I'm still in doubt... forgive me ;)<BR/><BR/>At compile time it is not known which implementing class will be assigned to a reference of an interface type (or a class type). The actual class is determined at runtime as you'll surely know. Thus all methods that are allowed to be called on a reference type are those methods that are defined for that Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7955003209126272036.post-15018248306911861622008-06-24T12:25:00.000+05:302008-06-24T12:25:00.000+05:30Thanks for your feedback Martin!I think, an Interf...Thanks for your feedback <B>Martin</B>!<BR/><BR/>I think, an Interface can't inherit from a Class in Java.[i] "Everything in Java inherits from Object" (taken from your feedback) [/i]should actually be "Every Class in Java inherits from Object".<BR/><BR/>We can surely call Object methods on a reference of an interface type as to have a valid assignment to that reference type in Java, one needs toGeekhttps://www.blogger.com/profile/00648920090539126396noreply@blogger.comtag:blogger.com,1999:blog-7955003209126272036.post-10443836690534849262008-06-24T01:29:00.000+05:302008-06-24T01:29:00.000+05:30Good article! One minor thing though: Interfaces d...Good article! <BR/><BR/>One minor thing though: Interfaces do of course inherit all methods from Object. Everything in Java inherits from Object. Try it out in Eclipse or whatever IDE you prefer. You're able to call Object's methods on every reference of an interface type.<BR/><BR/>MartinAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-7955003209126272036.post-9057745831003791392008-05-16T14:00:00.000+05:302008-05-16T14:00:00.000+05:30What a detailed explanation! Good work. A common q...What a detailed explanation! Good work. A common que but never seen such an answer.Anonymousnoreply@blogger.com