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();
}  


Ask a Question



Most Viewed Articles (in Interview )

Interview Question: What is ActionServlet?

Interview Question: What about JSTL and JavaServer Faces ?

Explain the different forms of Polymorphism.

Interview Question: Who makes the Struts?

Interview Question: Why it is called Struts?

Interview Question: What is Struts Validator Framework?

Interview Question: Is Struts compatible with other Java technologies?

Interview Question: Does Struts include its own unit tests?

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

Interview Question: What are the optional clauses in EJB QL?

Interview Question: What is difference between EJB 1.1 and EJB 2.0?

Interview Question: Is Decorator an EJB design pattern?

Interview Question: Can i map more than one table in a CMP?

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

Interview Question: What is deployment descriptor?

Latest Articles (in Interview)

Comment on this tutorial