Well, I'm not Dale, but it sounds to me like you're
starting to get the hang of interfaces -- the
ActionListener interface, like the Runnable interface,
allows code in some other class (something in Swing for
ActionListener, Thread for Runnable) to make a callback
to code in your class (actionPerformed() or run()
respectively). Do you also feel like it's starting to
make sense to you?
(I'm wondering in writing this reply what you mean by
"thats interesting" in your first paragraph. It's
obviously a reply to something someone else wrote, but
I can't easily find that previous post, and since you
didn't quote .... Well, maybe it's just the antique
newsreader I use, but I think there's a case to be made
for quoting a bit of what you're replying to.)
I agree about quoting what your replying to. So many
programmers use of language is terrible. They know exactly
the flow of their meaning but do their readers? Not often I
suggest (or is it just me?)
As for Interfaces, all the text books seem to say is 'contracts'
and empty methods stubs, but the practical use of
Intefaces is usually the fact that the method that is
called in our own classes are in fact called from,
a helpful class, like Thread or ActionListener where
all the hard work is done for us. This is the Multiple
Inheritance-like behavior that I was looking for and
was never explained in books (or anywhere). Explanations
like 'a cat is a mammal that cannot fly and eats fish
pizzas but not worms on Sundays' leaves my head reeling.
But the looking in the class Thread and actually seeing
it call run() after doing a bit of magic is an
understandable use of Interfaces IMHO.
I think I get them now. THANKS TO ALL (shouting).
or ActionListener