Newbie here. how can i implement this interface?

Discussion in 'Java' started by beau, Aug 30, 2003.

  1. beau

    beau Guest

    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. :p 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
    beau, Aug 30, 2003
    #1
    1. Advertising

  2. 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. :p 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/tutorial/java/interpack/interfaces.html
    Thomas Kellerer, Aug 30, 2003
    #2
    1. Advertising

  3. beau

    E.C. Bäck Guest

    "beau" <> wrote in message
    news:...
    > 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. :p 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
    E.C. Bäck, Aug 30, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bruce Sam
    Replies:
    5
    Views:
    7,807
    Mike Schilling
    Jan 13, 2005
  2. George Hester

    Try over here likely more to the point here

    George Hester, Sep 30, 2004, in forum: Javascript
    Replies:
    0
    Views:
    104
    George Hester
    Sep 30, 2004
  3. FAQ server
    Replies:
    0
    Views:
    149
    FAQ server
    Aug 10, 2006
  4. FAQ server
    Replies:
    0
    Views:
    123
    FAQ server
    Oct 7, 2006
  5. FAQ server
    Replies:
    0
    Views:
    140
    FAQ server
    Dec 4, 2006
Loading...

Share This Page