Results 1 to 15 of 15

Thread: Interface help

  1. #1
    tdman is offline Member
    Join Date
    Jun 2011
    Posts
    18
    Rep Power
    0

    Default Interface help

    All done now thank you
    Last edited by tdman; 06-01-2011 at 11:47 PM. Reason: sorted

  2. #2
    goldest's Avatar
    goldest is offline Senior Member
    Join Date
    Oct 2009
    Location
    Pune, India
    Posts
    469
    Rep Power
    5

    Cool

    Suggested reading : Interfaces

    Goldest
    Java Is A Funny Language... Really!
    Click on * and add to member reputation, if you find their advices/solutions effective.

  3. #3
    tdman is offline Member
    Join Date
    Jun 2011
    Posts
    18
    Rep Power
    0

    Default

    Ok I know the idea of an Interface but what I dont know is what to do to implement the in the other classes, what your have to do in them other classes etc...
    It might say it in the link you gave but its not clear there when concerning my problem...

    So an Interface is like a contract in Java... Other classes can use them without knowing the method. So do I have to write a new method for every class that implements an interface?

    For example, I have these two things in the interface which I want implemented in other classes.
    Java Code:
       public void moveToCentreStage();
       public void performDanceStep(int stepNumber);
    What do I need to do to implement them in another class? I know you have to write something like:
    Java Code:
     public class DancingRobot implements DanceMoves
    So do I put the interface things into instance variables?
    Where do I put these? Do I just put them as a new method like you would do anyway?

    Kind regards


  4. #4
    Jodokus's Avatar
    Jodokus is offline Senior Member
    Join Date
    Jan 2011
    Location
    Amsterdam, the Netherlands
    Posts
    230
    Rep Power
    4

    Default

    @OP:
    Don't edit/remove a first/previous post (apart from minor corrections that don't interfere with the thread's meaning). I'm passing by hoping to read something interesting, and you just "teared the first page out of my book".
    Close a thread but don't ruin it!
    Last edited by Jodokus; 06-02-2011 at 12:28 AM. Reason: spelling
    No bug ever had to calculate its fitnessfunction.

  5. #5
    tdman is offline Member
    Join Date
    Jun 2011
    Posts
    18
    Rep Power
    0

    Default

    How do you close a thread?


    Basically I cant have anything to do with what I'm doing over the Web because it will be cross referenced by my tutor!

    Sorry about that! I didnt know there was a way to delete a thread or 'close' as you say?

    regards
    Last edited by tdman; 06-02-2011 at 12:26 AM.

  6. #6
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default

    Quote Originally Posted by tdman View Post
    Basically I cant have anything to do with what I'm doing over the Web because it will be cross referenced by my tutor!
    So what? How else are you supposed to learn?

    On these forums at least, you'll find that people won't simply hand you complete solutions. They'll demand that you show your work and ask intelligent questions, and then only give you enough help to solve the problem yourself. If your tutor has a problem with that... frankly, you need a new tutor.
    Get in the habit of using standard Java naming conventions!

  7. #7
    Jodokus's Avatar
    Jodokus is offline Senior Member
    Join Date
    Jan 2011
    Location
    Amsterdam, the Netherlands
    Posts
    230
    Rep Power
    4

    Default

    How do you close a thread?
    Uhmm. I have to admit I can't find it anymore. I thought is was under threadtools if you're in your own thread, but I just failed to find it. (I also don't see recent closed threads anymore.)
    For the moment I appreciate your concern ;>) Can anybody else help out how to close a thread?
    Last edited by Jodokus; 06-02-2011 at 01:18 AM.
    No bug ever had to calculate its fitnessfunction.

  8. #8
    tdman is offline Member
    Join Date
    Jun 2011
    Posts
    18
    Rep Power
    0

    Default

    Quote Originally Posted by kjkrum View Post
    If your tutor has a problem with that... frankly, you need a new tutor.
    I'm just afraid it would be classed as cheating or something stupid! I do like that the guys dont give direct answers but sometimes I just need something from the direct answer to get me going!

  9. #9
    tdman is offline Member
    Join Date
    Jun 2011
    Posts
    18
    Rep Power
    0

    Default

    Quote Originally Posted by Jodokus View Post
    For the moment I appreciate your concern ;>)
    Thank you

  10. #10
    goldest's Avatar
    goldest is offline Senior Member
    Join Date
    Oct 2009
    Location
    Pune, India
    Posts
    469
    Rep Power
    5

    Cool

    Quote Originally Posted by Jodokus View Post
    @OP:
    Don't edit/remove a first/previous post (apart from minor corrections that don't interfere with the thread's meaning). I'm passing by hoping to read something interesting, and you just "teared the first page out of my book".
    Close a thread but don't ruin it!
    Absolutely right!

    tdman, next time if you do any stuff like this, you will be reported for banning. Because now this thread is as good as garbage.

    Make sure you won't repeat this in future.

    Goldest
    Java Is A Funny Language... Really!
    Click on * and add to member reputation, if you find their advices/solutions effective.

  11. #11
    tdman is offline Member
    Join Date
    Jun 2011
    Posts
    18
    Rep Power
    0

    Default

    Quote Originally Posted by goldest View Post

    tdman, next time if you do any stuff like this, you will be reported for banning. Because now this thread is as good as garbage.
    Goldest, ok so instead of making everyone go through SO much pain, how can I delete a thread?

  12. #12
    goldest's Avatar
    goldest is offline Senior Member
    Join Date
    Oct 2009
    Location
    Pune, India
    Posts
    469
    Rep Power
    5

    Cool

    Quote Originally Posted by tdman View Post
    Goldest, ok so instead of making everyone go through SO much pain, how can I delete a thread?

    You are not supposed to delete the thread once you get the answers to your questions. Now about this thread, you can't delete it.

    But just keep in mind next time, that don't delete the contents of your primary posts which describes the problem. Because if you do that, other people willing to help you or coming across same issues won't get to know what happened here and they simply end up seeing a blank first entry.

    Hope you understand that,

    Goldest
    Java Is A Funny Language... Really!
    Click on * and add to member reputation, if you find their advices/solutions effective.

  13. #13
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,416
    Rep Power
    20

    Default

    The purpose of a forum is to share problems and their possible solutions. This isn't just a free helpdesk, although it may sometimes appear that way.

    Forum posts also form a repository of knowledge and discussion, and all prominent forums (including this one) are indexed by the major search engines. If you don't believe that, take the first sentence from any post more than about 15 minutes old and plug it into Google, and see what you get as the first hit.

    So, don't repeat this. If you have a copy of your original post, please edit again and restore the content.

    db

  14. #14
    tdman is offline Member
    Join Date
    Jun 2011
    Posts
    18
    Rep Power
    0

    Default

    Ok guys, this wont happen again... Sorry for the hassle I have caused. I just didn't want my tutor to find it! Next time I will re phrase everything in examples that do have any keywords that I am doing at the moment!

    So again sorry people.

    Kind regards

  15. #15
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,091
    Rep Power
    20

    Default

    Why would your tutor be worried that you were asking for help?
    It's not as if any of us here hand out cookie-cutter solutions...

Similar Threads

  1. Interface
    By Anandiscool in forum New To Java
    Replies: 3
    Last Post: 05-02-2010, 07:51 AM
  2. Is there a GUI interface for...
    By smith427 in forum New To Java
    Replies: 3
    Last Post: 12-03-2009, 07:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •