Re: Own implementation of an interface
- From: Luca Paganelli <ask@xxxxx>
- Date: Sat, 28 Oct 2006 01:25:06 +0200
An interface is simply a definition of the way a class is expected to "act". It's a collection of definition of methods each of which must be implemented for a class to be said "implementing" that interface.
To create an implementation of an interface either you can write it "implements" that interface and implement every single interface method, or you can write it extends another class that implements the interface and override those methods that must have custom implementation/behavior.
Luca.
gabriel ha scritto:
Hi.
Firstly i'd like to thank you for reading this and offer my appreciation for replies in advance.
I've recently been writing a program which implements a user-defined API (Robocode to be exact). I, however, need to create my own implementation of an interface in order to perform some arbitary function.
My question is, how would i go about creating my own instance of this interface so that the API utilises my methods instead of the blank, skeleton ones already provided?
Is it simply Public interface myInterface extends APIInterfaceCLassNAMe?
or is there some other method?
As far as java goes i've always been a little hazey around the concept of interfaces, thus my confusion.
thanks
Gabriel
- References:
- Own implementation of an interface
- From: gabriel
- Own implementation of an interface
- Prev by Date: Own implementation of an interface
- Next by Date: Re: 3D & web application ?
- Previous by thread: Own implementation of an interface
- Next by thread: Re: Own implementation of an interface
- Index(es):
Relevant Pages
|
|