Results 1 to 5 of 5

Thread: Interfaces

  1. #1
    blobbyx22 is offline Member
    Join Date
    Nov 2011
    Posts
    1
    Rep Power
    0

    Default Interfaces

    Hello I'm new to the forums and want to try this out to expand my knowledge in programming!

    I have an interface and three classes

    How do you link the three classes to this interface like a hierarchy.

    Thanks for your time.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Interfaces

    Quote Originally Posted by blobbyx22 View Post
    I have an interface and three classes
    How do you link the three classes to this interface like a hierarchy.
    I can't speak for everyone, but I don't have a clue as to what you're asking based on what you've posted. If you don't get a decent and complete answer soon, consider clicking on the link in my signature links below on how to ask smart question. It will give suggestions on what you need to tell us so your question is actually answerable. Also consider posting the exact wording of your assignment.

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,433
    Blog Entries
    7
    Rep Power
    20

    Default Re: Interfaces

    Quote Originally Posted by blobbyx22 View Post
    I have an interface and three classes

    How do you link the three classes to this interface like a hierarchy.
    I guess that the three classes have to implement the single interface; if a class C2 extends a class C1 and class C1 implements your interface then class C2 also implements your interface. I suggest you use pen and paper and doodle all possible configurations for your three classes. If they form a hierarchy by themselves only the root of that hierarchy needs to implement the interface. It they form a 'forest' or 'heterarchy' the roots have to implement the interface. I doubt I fully understand your question ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    mochie is offline Member
    Join Date
    Nov 2011
    Posts
    1
    Rep Power
    0

    Default Re: Interfaces

    I need some help,,how can i make this payroll in simplst syntax


    .Create a class named Pay that includes 5 double variables that hold hours worked, rate of pay per hour, withholding rate, gross pay, and net pay. Create three overloaded computeNetPay() methods. When computeNetPay() receives values for hours, pay rate, and withholding rate, it computes the gross pay and reduces it by the appropriate withholding amount to produce the net pay. When computeNetPay() receives two arguments, they represent the hours and pay rate, and the withholding rate us assumed to be 10%. When computeNetPay() receives one argument, it represents the number of hours worked, the withholding rate is assumed to be 10%, and the hourly rate is assumed to be 5.65. Name the program as Pay.java

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,433
    Blog Entries
    7
    Rep Power
    20

    Default Re: Interfaces

    #Mochie: Please don't hijack some else's thread; start your own thread.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Interfaces
    By dalu in forum New To Java
    Replies: 4
    Last Post: 04-26-2011, 12:22 PM
  2. Interfaces (not GUI)
    By guilty in forum Advanced Java
    Replies: 1
    Last Post: 11-05-2010, 07:16 PM
  3. interfaces..
    By sireesha in forum New To Java
    Replies: 5
    Last Post: 01-16-2008, 05:52 PM
  4. Interfaces
    By Kavana Krishnappa in forum New To Java
    Replies: 7
    Last Post: 12-11-2007, 04:28 PM
  5. Interfaces
    By imran_khan in forum New To Java
    Replies: 5
    Last Post: 07-30-2007, 08: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
  •