Results 1 to 2 of 2
  1. #1
    sathishvegeta is offline Member
    Join Date
    Feb 2013
    Rep Power

    Default About Abstract class??

    Does anyone give me clear view of abstract class and purpose of using abstract and the difference between abstract class and interface??

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    New Zealand
    Rep Power

    Default Re: About Abstract class??

    Abstract classes can implement methods which interfaces cannot do.

    Classes (abstract or not) as well as interfaces allow the programmer to define types. Types specify the behavior that an object has. For instance we might want a log behavior - where an object is intended to send some data about itself to a stream. So we declare a log() method. We can do this in a concrete MyLoggingFoobar class, an abstract AbstractLog class or a Loggable interface. Abstract classes - like interfaces - are not intended to be directly instantiated: instead we instantiate a concrete subclass (or a class that implements an interface.)

    Wikipedia tends to be very good at answering these sorts of question - many heads generally produce something than an "off the cuff" you'll get here, and W's computer science articles are generally informative and accessible. This isn't intended to put you off - if Wikipedia or any other source suggests a specific questoon, or if they are unclear, post away!

Similar Threads

  1. abstract method-abstract class
    By durgaprasad1407 in forum New To Java
    Replies: 1
    Last Post: 04-29-2011, 06:58 PM
  2. Replies: 4
    Last Post: 04-14-2011, 11:42 AM
  3. How can I call abstract class methods from another class
    By srinivas2828 in forum New To Java
    Replies: 13
    Last Post: 03-12-2010, 02:33 PM
  4. Replies: 6
    Last Post: 02-11-2009, 10:51 AM
  5. Replies: 0
    Last Post: 04-02-2008, 07:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts