Is it something like interfaces are used to implement multiple inheritance?
SCJP1.4
"Continuous effort - not strength or intelligence - is the key to unlocking our potential."
*Winston Churchill
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
SCJP1.4
"Continuous effort - not strength or intelligence - is the key to unlocking our potential."
*Winston Churchill
khurram shahood(Java Farmer)
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Originally posted by Mapraputa Is:
July's JavaPro published James Cooper's review for "Design Patterns Java Workbook", and the very question happened to be one of the "challenges": "Write down three differences between abstract classes and interfaces in Java".
Here is what James Cooper came up with:
"1) Abstract classes may have some executable methods and methods left unimplemented. Interfaces contain no implementation code.
2) A new class can inherit from an abstract class, but not also from another class. A new class can inherit from any class and still implement one or more interfaces
3) Interfaces do not specify constructors."
And here is what the book lists:
"1) a class can implement any number of interfaces, but subclass at most one abstract class.
2) an abstract class can have nonabstract methods. All methods of an interface are abstract.
3) An abstract class can have instance variables. An interface cannot.
4) An abstract class can define constructor. An interface cannot.
5) An abstract class can have any visibility: public, protected, private or none (package). An interface's visibility must be public or none (package).
6) An abstract class inherits from Object and includes methods such as clone() and equals().
Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>