Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions? | Software Development
 

Java Abstract Class

An abstract class is a class that is declared by using the abstract keyword.

Java Abstract Class

                         

An abstract class is a class that is declared by using the abstract keyword. It may or may not have abstract methods. Abstract classes cannot be instantiated, but they can be extended into sub-classes.

                                                                                                      --or--

Java provides a special type of class called an abstract class. Which helps us to organize our classes based on common methods. An abstract class lets you put the common method names in one abstract class without having to write the actual implementation code.

An abstract class can be extended into sub-classes, these sub-classes usually provide implementations for all of the abstract methods.

The key idea with an abstract class is useful when there is common functionality that's  like to implement in a superclass and some behavior is unique to specific classes. So you implement the superclass as an abstract class and define methods that have common subclasses. Then you implement each subclass by extending the abstract class and add the methods unique to the class.
     
Points of abstract class :

  1. Abstract class contains abstract methods.
  2. Program can't instantiate an abstract class.
  3. Abstract classes contain mixture of non-abstract and abstract methods.
  4. If any class contains abstract methods then it must implements all the abstract methods of the abstract class.

                         

» View all related tutorials
Related Tags: c class ant methods classes method trac int abstract to extend sse ext e it not bstr can in no

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
 
Tell A Friend
Your Friend Name

 

 
Recently Viewed
Software Solutions
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.