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 the difference between EAR, JAR and WAR file?

Interview Question: What is deployment descriptor?

Can Entity Beans have no create() methods?

Explain garbage collection?

What types of comments are available in the JSP?

Interview Question: What is Struts?

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

Interview Question: If the framework doesn't do what I want, can I request that a feature be added?

Interview Question: Do ActionForms have to be true JavaBeans?

Interview Question: What is the difference between sessioncontext and entitycontext?

Interview Question: What is re-entrant. Is session beans reentrant. Is entity beans reentrant?

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

Interview Question: What is the difference between Message Driven Beans and Stateless Session beans?

What do you understand by a J2EE module?

What are the services provided by a container?

Latest Articles (in Interview)

Comment on this tutorial