Results 1 to 3 of 3
  1. #1
    eva
    eva is offline Member
    Join Date
    Dec 2007
    Posts
    49
    Rep Power
    0

    Default Implementing more than one interfaces

    My intend is to implement 2 interfaces. I tried the following:

    Java Code:
    public class Jumper implements ShedA implements ShedB {
    
    }
    ShedA and ShedB are the interfaces. I am not able to compile the class. Please indicate where I went wrong.

    - PEACE

  2. #2
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    8

    Default

    You want to do:
    Java Code:
    public class Jumper implements ShedA, ShedB {
    ...
    }
    Your class can implement more than one interface (Java supports multiple interface inheritance), so the implements keyword is followed by a comma-delimited list of the interfaces implemented by the class.
    Last edited by CaptainMorgan; 12-23-2007 at 04:12 PM.

  3. #3
    eva
    eva is offline Member
    Join Date
    Dec 2007
    Posts
    49
    Rep Power
    0

Similar Threads

  1. interfaces..
    By sireesha in forum New To Java
    Replies: 5
    Last Post: 01-16-2008, 06:52 PM
  2. Interfaces
    By Kavana Krishnappa in forum New To Java
    Replies: 7
    Last Post: 12-11-2007, 05:28 PM
  3. Interfaces
    By imran_khan in forum New To Java
    Replies: 5
    Last Post: 07-30-2007, 09:11 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
  •