One more difference

Abstract Classes cannot be instantiated
however an interface reference can be created as shown below.

Example : List deepak = new ArrayList(); // usage of Interface in
Collections.

In the above example the "deepak" reference created has the implementation
for ArrayList() as defined in RHS.( see javadoc api for further details of
ArrayList() implementation or methods)


On Sat, Mar 14, 2009 at 12:04 AM, K.R.A.3 <[email protected]> wrote:

>
> hi,
> Very simply,
> Interface is a set of function that its implementing classes must
> define.
> Abstract classes are just like interfaces with an exception, Some of
> its functions are already defined in it.
> So they will not need to be implemented.
> We can implement any number of interfaces but in the case abstract
> class, only one is possible also no further derivation from another
> classes.
>
> Arun.K.R
>
> On Mar 13, 10:59 pm, Shawn Ayromloo <[email protected]> wrote:
> > See the following URL:
> >    http://mindprod.com/jgloss/interfacevsabstract.htmlShawn Ayromloo
> > Amit Mishra wrote:Hi,
> >
> >
> >
> > Can anyone explain what's the differece between
> >
> > an Abstract class and an Interfce.
> >
> >  where we should use an Abstract class?
> >
> > and where should we use an Interface?
> >
> >
> >
> > Thank you.
> >
> > Amit
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to