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 re-entrant. Is session beans reentrant. Is entity beans reentrant?

Question: Difference between forward and sendRedirect in JSP?

Explain garbage collection?

What is Collection API?

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

What is the difference between interface and abstract class?

Interview Question: Write code of any Action Class?

What are all the different scope values for the tag?

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

What are Access Specifiers available in Java?

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

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

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

What are the contents of web module?

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

Latest Articles (in Interview)