Java – Constructor in an Interface?

This is one of the frequently asked interview question. No, We cannot have a Constructor defined in an Interface. A method in a interface will be public and abstract by default to provide 100% abstraction and the implementation(method body) will be provided by the implementing class.In this article we will get to know why Constructors are not allowed in Interface.  [Read more…]

Difference Between Interface and Abstract Class in Java

This is one of the most frequently asked question in the interview. Many interviewers will not leave this topic. So lets see the difference between them

  • The main difference is that the Interfaces are implicitly abstract and cannot have implementation, whereas the abstract class can have the concrete class.
  • Interface are implemented using the “implements” keyword. Abstract class can be extended using the “extends” keyword. [Read more…]