...

View Full Version : java implementing question



warhammerdude20
03-15-2004, 04:16 PM
i am making an applet that requieres i implement Runnable as well as KeyListener...

is it possible to go something like:


class Whatever implements Runnable implements KeyListener{


thanks

shmoove
03-15-2004, 05:00 PM
Yes, but your syntax is a bit off:


class Whatever implements Runnable, KeyListener{

As long as you make sure to implement all the necesary methods (but I guess you already know that), you'll be fine.
Multiple "implements" is exactly the reason they have interfaces in Java, so you wouldn't need multiple inheritance (it's safer using interfaces).

shmoove

warhammerdude20
03-15-2004, 07:47 PM
again, shmoove,

thanks. your a helpful person



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum