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

abstract class vs. interface (coursework)

Experts,

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.
0
AbhiJeet
Asked:
AbhiJeet
2 Solutions
 
AbhiJeetAuthor Commented:
The theory should be relevant to delphi only.
0
 
Geert GOracle dbaCommented:
this looks a lot like homework

abstract class:
http://www.delphibasics.co.uk/Article.asp?Name=Abstract

interface
http://www.delphibasics.co.uk/Article.asp?Name=Interface

scenario ?
you can always use either

4:
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

0
 
Geert GOracle dbaCommented:
0
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.

 
8080_DiverCommented:
Definitely sounds like either homework or a take-home test. ;-)
0
 
overtheclock007Commented:
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
0
 
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

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

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.
0
 
mlmccCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
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