Difference between Abstract class and interface

V

vishist

Hi,
Can you let me know the difference between Abstract class and
interface. I did research on the topic and found it helpful. Well, the
refined question I have is
1. Is there any difference between abstract class for which all the
methods are declared abstract and then an interface. I know that with
interface, multiple inhertiance can be achieved.
Can you please tell me in object tree/method invocation view.

thanks in advance
 
R

Raanan

Well,

I'm not an expert but if I remmber correctly..

the interface is only definitions of functions..
a new class can implements mulitiple interfaces...

an abstract class is like an unfinnished class... :) lets you implement
some of the functions by your self but some of the functions might be
already implemented and even private.
and I think you can use only abstarct class to father your new class.

Raanan,
http://www.infoservicesonline.com
 
T

Tor Iver Wilhelmsen

vishist said:
Can you let me know the difference between Abstract class and
interface.

An abstract class can contain method implementation, instance fields,
constructors and static methods. An interface cannot. An abstract
class is part of the single-inheritance chain, an interface is not.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top