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 )

What are implicit Objects available to the JSP Page?

Interview Question: Does Struts include its own unit tests?

Explain the user defined Exceptions?

The output of System.out.println(5<<2) in Java

Differentiate between .ear, .jar and .war files.

Interview Question: What is Remote client view?

What is the difference between jsp:include page and @ include file?

What is transient variable?

Interview Question: Why does EJB needs two interfaces(Home and Remote Interface)?

Interview Question: Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB?

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

What is the difference between interface and abstract class?

What do you understand by JTA and JTS?

Interview Question: What is Deployment descriptor?

Interview Question: What is ActionServlet?

Latest Articles (in Interview)