Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: subclass that implements

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default subclass that implements

    I have a problem where i have to add 2 interfaces into class hierarchy of 1 main class.

    it reads: Simulate multiple inheritance by adding at least two
    interfaces into your class hierarchy.

    However As far as I know you can't implement and extend at the same time. You are creating a main class followed by 4 subclasses. I know i could implement one interface on the main class but how would I do this for the subclasses?


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,967
    My Mood
    Hungover
    Thanks
    133
    Thanked 554 Times in 475 Posts

    Default Re: subclass that implements

    Quote Originally Posted by speedycerv View Post
    However As far as I know you can't implement and extend at the same time.
    What happened when you tried? Also, what happened when you tried to implement from multiple interfaces?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Implements
    By p_dibb in forum Java Theory & Questions
    Replies: 2
    Last Post: March 16th, 2011, 08:04 AM
  2. Instantiating a SuperClass Map from a SubClass
    By drexasaurus in forum Collections and Generics
    Replies: 1
    Last Post: September 9th, 2010, 10:51 PM
  3. [SOLVED] implements MouseListener doesn't work why
    By voltaire in forum AWT / Java Swing
    Replies: 2
    Last Post: May 1st, 2010, 04:30 PM