This week's book giveaway is in the
We're giving away four copies of a choice of
"Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac"
and have Joe Kissell on-line!
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Take Control of Upgrading to Yosemite
Take Control of Automating Your Mac
this week in the
Abstact or to Interface?!
Joined: Dec 07, 2004
Dec 11, 2004 07:58:00
I have been tucking into my Deitel book: "How to program Java" and I have a question to be clarified.
My question is: when to use abstract classes and interface??! The book doesn't really clarify the difference between them. Can anyone help me out?
Many thanks in advance,
- The Atomic Moonfrog
Joined: Mar 13, 2004
Dec 11, 2004 10:20:00
Advantage of interface: You can implement any number of interfaces while you can only extend one class.
Advantage of abstract class: You can supply the implementation of some methods but not others. Interfaces cannot supply any method implementations.
There is a lot more here if you search on the terms "abstract" and "interface".
SCJP 1.4, SCWCD in process
Joined: Aug 20, 2001
Dec 13, 2004 15:59:00
for a Realy Good Explination (TM) for interface and abstract classes. (Of course, this is just my humble opinion
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Joined: Dec 06, 2001
Dec 13, 2004 16:10:00
This question has been asked a lot before, so you can use
the Search tool
if you would like more information on it.
Java API Documentation
The Java Tutorial
subject: Abstact or to Interface?!
Root Interfaces for Collection
Interface doubt from K&B
Access modifer to interface
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014