How to define an Abstract class?

By: Karthik Printer Friendly Format    


Answer: A class containing abstract method is called Abstract class. An Abstract class can't be instantiated.

Example of Abstract class:

abstract class testAbstractClass { 
    protected String myString; 
    public String getMyString() { 
        return myString; 
        } 
    public abstract string anyAbstractFunction();
}  


Most Viewed Articles (in Interview )

Interview Question: Why it is called Struts?

Interview Question: What is ActionServlet?

Interview Question: What about JSTL and JavaServer Faces ?

Interview Question: Is there a particularly good IDE to use with Struts ?

Interview Question: Why are some of the class and element names counter-intuitive?

Interview Question: What is Local client view in EJB?

Interview Question: What is the difference between EAR, JAR and WAR file?

Interview Question: How many EJB Objects are created for a Bean?

Interview Question: What is the difference between find and select methods in EJB?

Types of Interviews

Question: How is the MVC design pattern used in Struts framework?

What is J2EE?

What is Deployment Descriptor?

What do you understand by JTA and JTS?

What is similarities/difference between an Abstract class and Interface?

Latest Articles (in Interview)

Comment on this tutorial