Programming Tutorials

How to define an Abstract class?

By: Karthik in Interview Tutorials on 2012-06-16  

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





Add Comment

* Required information
1000

Comments

No comments yet. Be the first!

Most Viewed Articles (in Interview )

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

Question: What is the directory structure of a web application?

Interview Question: What is Deployment descriptor?

What is difference between Java Bean and Enterprise Java Bean?

Name the containers which uses Border Layout as their default layout?

What are the services provided by a J2EE container?

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

Question: Explain the life-cycle methods in JSP?

Explain the Polymorphism principle.

Interview Question: Is Struts compatible with other Java technologies?

Question: What is an output comment in JSP?

What types of comments are available in the JSP?

Interview Question: What is Action Class?

Getting started with Interview

What is the difference between JTS and JTA?

Latest Articles (in Interview)