Sunday, 15 January 2012
JAVA : What is the difference between an Interface and an Abstract class?
Do you like this Article?
An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods.
Subscribe to:
Post Comments
(
Atom
)
Popular Posts
-
public - public means everyone can access it.That means it's in global scope. As, main method is called by JVM [ Java Virtual Machine...
-
throw is used to throw an exception in a program, explicitly . Whereas, throws is included in the method's declaration part, wi...
-
Singleton in one of the most popular yet controversial design pattern, in the world of object oriented programming. It's one of t...
-
Web Container / Servlet Container / Servlet Engine : In J2EE Architecture , a web container (also known as servlet container or ser...
-
Program compiles. But at runtime throws an error “NoSuchMethodError”.
-
Vector : It's synchronized. It's slower than ArrayList. It's generally used in ...
-
doGet(): protected void doGet(HttpServletRequest req, HttpServletResponse resp)throws ServletException, java.io.IOException – is a met...
-
In Java Programming Language , we must declare a variable name and type, before using it. The data type of a variable defines the th...
1 Responses to “ JAVA : What is the difference between an Interface and an Abstract class? ”
13 January 2020 at 17:59
Very nice post. Really very attractive information. Thanks for sharing.
Advanced Java training
Post a Comment