Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 25-01-2010
Member
 
Join Date: Dec 2009
Posts: 68
Use of abstract classes

Hi All,

I am IT student with few confusion about some concepts of the object oriented programming. I need your help to be aware about the use of abstract classes. I know that abstract class doesn't comprises any content. But didn't get the intention behind this methodology. If you know something about the use of abstract classes, then please let know the same. I am waiting for your reply.
Reply With Quote
  #2  
Old 25-01-2010
Member
 
Join Date: May 2008
Posts: 2,383
Re: Use of abstract classes

Abstract class in an Object Oriented Programming used to enforce some rules to the classes which implements. Class which derived from super class must comprises common properties.Providing the Abstract functionality to object is one of the powerful concepts by java. In addition to this concept the derive class can have its own methods like "Swim()".Abstract classes cannot be instantiated; they must be sub classed, and actual implementations must be provided for the abstract methods.
Reply With Quote
  #3  
Old 25-01-2010
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: Use of abstract classes

The abstract class is a hybrid between a class and a conventional interface. It provides a generic implementation to subclasses and also asks them to implement certain things for which the abstract class can not decide. An abstract class is a class whose methods are abstract security hole when we declare an abstract method automatically you must define the class "abstract" and is generally used when other classes will inherit from this class and they are same method as the super class have therefore written to not repeat the same methods each time in these classes.
Reply With Quote
  #4  
Old 25-01-2010
Member
 
Join Date: Jan 2008
Posts: 1,515
Re: Use of abstract classes

Abstract classes are very useful to develop methods that depend on other methods that are not specified. In C + +A class is abstract if it contains at least one pure virtual method declared, that is to say, beginning with virtual and terminated = 0. This type of class is not instantiable. You can still create pointers or references to the type of abstract class that will point or reference objects of a class derived non-abstract. A pure virtual function should be reasserted explicitly defined or pure virtual. A subclass of an abstract class is abstract if it still does not define all abstract methods it inherits.
Reply With Quote
  #5  
Old 25-01-2010
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: Use of abstract classes

abstract class modifier used when declaring a class or method. We then say that the class or method is abstract. An abstract method has its prototype, that is to say, its return type followed by its name, followed by the list of parameters between parentheses, followed by a semicolon. An abstract method can not be declared static or private or Final. Once a class has one abstract method, it must also be declared abstract. An abstract class can not be instantiated. It will extend and define all the abstract methods in it to use it.
Reply With Quote
  #6  
Old 25-01-2010
Member
 
Join Date: May 2008
Posts: 2,008
Re: Use of abstract classes

In case of Interface the derived class can implement any number of interface but restricted to extend single abstract class. It makes pointers or references to the type of abstract class that will point or reference objects of a class derived non-abstract. Providing the Abstract functionality to object is one of the powerful concepts by java. Abstract classes are used to enforce some rules to the classes which implements. In case of Abstract class we can define COMMON functionality in super class and those can be used in the derived class where as in Interface we cant do that.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Use of abstract classes"
Thread Thread Starter Forum Replies Last Post
Difference between Abstract classes and Interfaces in C# Gallard Software Development 8 21-05-2012 11:58 AM
Table and abstract classes TechGate Software Development 5 03-03-2010 10:49 AM
What is Abstract methods? ScarFace 01 Software Development 5 09-02-2010 11:59 AM
Abstract Classes in PHP5 nonose Software Development 2 16-06-2009 02:33 PM
Abstract class and Interface in .net RogerFielden Software Development 3 04-05-2009 06:07 PM


All times are GMT +5.5. The time now is 04:20 PM.