• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 543
  • Last Modified:

abstract class vs. interface (coursework)


Need expert comments on Abstract class vs Interface, i need full description covering ,

1. all the differeces between abstract class and interface
2. advantages, disadvantages of both
3. which scenario to use one or the other
4. Can abstract class contain constructor, if so can it be called? same for interface?
I need whole theory part for the both.
2 Solutions
AbhiJeetAuthor Commented:
The theory should be relevant to delphi only.
Geert GOracle dbaCommented:
this looks a lot like homework

abstract class:


scenario ?
you can always use either

yes it can be called as any class descends from TObject
and this contains a constructor per default
interface is just a placeholder for functions/procedures

Geert GOracle dbaCommented:
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Definitely sounds like either homework or a take-home test. ;-)
The question you asking makes nosense abstract class are class that only have body and are completly virtual. The only think that is define is the methods names and procedure, function of class.
The abstract class must have in some point a derivation to another where you define procedures and functions vars in and out.

A interface is a completly diferent thing. I will not write more because i think you get the point.

abstract class vs. interface question = MAKES NOSENSE
Geert GOracle dbaCommented:
there is actually a little sense to it :)

with abstract you can specify which function/procedure must be overridden
it could be just the 1

with interface you need to implement all function/procedure

writing a interface for a thread would be a lot more work than deriving from a abstract class

in essence any class becomes an abstract class if at least 1 member is abstract

Geert GOracle dbaCommented:
aikimark ...
you scared this person away before getting an answer

We haven't seen a comment since
The theory should be relevant to delphi only.

Open in new window

I doubt my comment scared anyone.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now