Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Newbie here. how can i implement this interface?

Reply
Thread Tools

Newbie here. how can i implement this interface?

 
 
beau
Guest
Posts: n/a
 
      08-30-2003
I hava interface like this

// public interface CalculatorFunction {
// public void invoke();
// }

I gotto overide it with some other classes in order to make it perform
like a pocket calculator. I wrote this

// public class One implements CalcultorFunction {
//

and that's it. my lecturer sucks, really hard to understand what
he taught. and after just more than 1 month of studying Java he gave
me this project.
In this class I want to implement the button 1 function. could
somebody help?
Thanks in advance!

Beau
 
Reply With Quote
 
 
 
 
Thomas Kellerer
Guest
Posts: n/a
 
      08-30-2003
beau schrieb:
> I hava interface like this
>
> // public interface CalculatorFunction {
> // public void invoke();
> // }
>
> I gotto overide it with some other classes in order to make it perform
> like a pocket calculator. I wrote this
>
> // public class One implements CalcultorFunction {
> //
>
> and that's it. my lecturer sucks, really hard to understand what
> he taught. and after just more than 1 month of studying Java he gave
> me this project.
> In this class I want to implement the button 1 function. could
> somebody help?
> Thanks in advance!
>
> Beau


http://java.sun.com/docs/books/tutor...nterfaces.html

 
Reply With Quote
 
 
 
 
E.C. Bäck
Guest
Posts: n/a
 
      08-30-2003
"beau" <> wrote in message
news: om...
> I hava interface like this
>
> // public interface CalculatorFunction {
> // public void invoke();
> // }
>
> I gotto overide it with some other classes in order to make it perform
> like a pocket calculator. I wrote this
>
> // public class One implements CalcultorFunction {
> //
>
> and that's it. my lecturer sucks, really hard to understand what
> he taught. and after just more than 1 month of studying Java he gave
> me this project.
> In this class I want to implement the button 1 function. could
> somebody help?
> Thanks in advance!
>
> Beau


That's crazy. You can't make that many classes and feel good about
yourself. If you keep this up, you'll have at least a dozen classes. But,
if you insist on it, you need to implement the interface. What that means
is that you need to have method in your child class with (in your case) a
void invoke method. Every variable or method specified (return types, too)
in an interface must be implemented in its children.
--
Elliott


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i implement [ Please wait ....!! your request is processing...] page ................. ~Maheshkumar.R ASP .Net 4 03-30-2005 04:17 PM
How can I implement the "Pushing" mode in Asp.Net application =?Utf-8?B?ZVhzZXJhcGg=?= ASP .Net 6 11-22-2004 08:39 PM
can we implement LIFO using SRL16 ??? Oleg VHDL 5 02-18-2004 10:29 PM
Newbie Question: Could someone show me how to implement options Borniac Perl Misc 6 09-18-2003 10:57 AM
newbie: how to implement splitter Matt Epstein Javascript 0 09-09-2003 02:09 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57