🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: aus.computers.java
3 messages
3 total messages Started by Raymond George Montalban Thu, 09 Mar 2000 00:00
Multiple interface implementation, etc.
#903
Author: Raymond George Montalban
Date: Thu, 09 Mar 2000 00:00
40 lines
1738 bytes
To all,

Could anyone help me with this problem please? I have asked around and
basically
everyone I know or am in contact with know *nothing* about Java. Anyway,

is it legal or possible to implement multiple interfaces?

I.e., is this following legal ...

public class GrammarWorld extends Applet implements Runnable,
ActionListener
{
.
.
.
}

???

(The line starting with "public class ..." is of my concern).

If I can't do the above, how do I implement both the ActionListener and
Runnable interaces
at the same time?

I need to be able to have both a sprite and a form on the same screen.
Or else I'm stuck
to having two separate screens - one with a Java sprite animating
various things
on a screen, and another with explanation. I'd like to have both of them
on the one
screen. Since I'm fairly new to OOP and Java in general, I really don't
want to go into
the Swing component library unless absolutely necessary.

Is there an easy way to split the screen into two parts?

Thanks for all your help in advance,
Raymond.
Re: Multiple interface implementation, etc.
#905
Author: Cannon
Date: Fri, 10 Mar 2000 00:00
45 lines
2065 bytes
Ray,

If you tried it you would realise that you can do what you had in mind.
Java unlike C++ does not support multiple inheritance but supports a special
interface mechanisam.
Special, because an interface can only declare methods (similar to an *.h
file), also you can not have final members declared in a interface ...etc
You declare pupblic if you want access from outside your package.

For your scenario I recomend you get JBuilder 3 (foundation is free) or
similar.
This will cut your development time 80%.
JBuilder has an JBCL library which is easier to manipulate then swing.

Hope this helps.


Raymond George Montalban <rmontal@ozemail.com.au> wrote in message
news:38C79C2C.7A336B02@ozemail.com.au...
> To all,
>
> Could anyone help me with this problem please? I have asked around and
> basically
> everyone I know or am in contact with know *nothing* about Java. Anyway,
>
> is it legal or possible to implement multiple interfaces?
>
> I.e., is this following legal ...
>
> public class GrammarWorld extends Applet implements Runnable,
> ActionListener
> {
> .
> .
> .
> }
>
> ???
>
> (The line starting with "public class ..." is of my concern).
>
> If I can't do the above, how do I implement both the ActionListener and
> Runnable interaces
> at the same time?
>
Re: Multiple interface implementation, etc.
#906
Author: Cannon
Date: Fri, 10 Mar 2000 00:00
61 lines
2720 bytes
> file), also you can not have final members declared in a interface ...etc

Ops, wrong statement, by final I meant it does not make sense declaring the
accessibility of members in the interface.
That is modifiers protected and private want work. final is encouraged and I
personally use it a lot to declare constances in a interface to reduce
clatter.



Cannon <cannon@nospam.basketball.net.au> wrote in message
news:<sb_x4.105$0n6.6058@nsw.nnrp.telstra.net>...
> Ray,
>
> If you tried it you would realise that you can do what you had in mind.
> Java unlike C++ does not support multiple inheritance but supports a
special
> interface mechanisam.
> Special, because an interface can only declare methods (similar to an *.h
> file), also you can not have final members declared in a interface ...etc
> You declare pupblic if you want access from outside your package.
>
> For your scenario I recomend you get JBuilder 3 (foundation is free) or
> similar.
> This will cut your development time 80%.
> JBuilder has an JBCL library which is easier to manipulate then swing.
>
> Hope this helps.
>
>
> Raymond George Montalban <rmontal@ozemail.com.au> wrote in message
> news:38C79C2C.7A336B02@ozemail.com.au...
> > To all,
> >
> > Could anyone help me with this problem please? I have asked around and
> > basically
> > everyone I know or am in contact with know *nothing* about Java. Anyway,
> >
> > is it legal or possible to implement multiple interfaces?
> >
> > I.e., is this following legal ...
> >
> > public class GrammarWorld extends Applet implements Runnable,
> > ActionListener
> > {
> > .
> > .
> > .
> > }
> >
> > ???
> >
> > (The line starting with "public class ..." is of my concern).
> >
> > If I can't do the above, how do I implement both the ActionListener and
> > Runnable interaces
> > at the same time?
> >
>
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads