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...]
ServletRequest Interface – Servlets
The ServletRequest Interface defines an object which is used to encapsulate information about the user's request, including parameter name/value pairs, attributes, and an input stream. … [Read more...]
Interface in Java and Uses of Interface in Java
Abstraction is a process of hiding the implementation details and showing only functionality to the user. Earlier we have learnt about abstract class in java which is used to achieve partial abstraction. In this tutorial, we will discuss about interfaces which are used for achieving full abstraction. … [Read more...]
Difference Between Interface and Abstract Class in Java
This is one of the most frequently asked questions in the interview. Many interviewers will not leave this topic. So let's see the difference between them The main difference is that the Interfaces are implicitly abstract and cannot have implementation, whereas an abstract class can have a concrete class. Interface is implemented using the "implements" keyword. Abstract … [Read more...]