April 2006
Intermediate to advanced
480 pages
8h 32m
English
(from page 12)
An abstract class with no nonabstract methods is similar to an interface in terms of its utility. However, note the following.
• A class can implement any number of interfaces but can subclass at most one abstract class.
• An abstract class can have nonabstract methods; all the methods of an interface are effectively abstract.
• An abstract class can declare and use fields; an interface cannot, although it can create static final constants.
• An abstract class can have methods whose access is public, protected, private, or none (package). An interface’s methods are implicitly public.
• An abstract class can define constructors; an interface cannot.
Read now
Unlock full access