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 )

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

What are types of J2EE clients?

What do you understand by Synchronization?

What is difference between Java Bean and Enterprise Java Bean?

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

Tell me something about J2EE component?

Interview Question: Do ActionForms have to be true JavaBeans?

What do you understand by JTA and JTS?

Interview Question: What is EJB client JAR file?

Interview Question: Can I invoke Runtime.gc() in an EJB?

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

Interview Question: What is the difference between ejbCreate() and ejbPostCreate?

What is similarities/difference between an Abstract class and Interface?

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

Is Iterator a Class or Interface? What is its use?

Latest Articles (in Interview)