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

    Default Implementing and Extending together

    I have following scenario:

    Java Code:
    public class Benz implements Basics extends BusinessLogic {
    …
    }
    Basics is an interface and BusinessLogic is a Java class. When I try to compile, I get following error:
    Java Code:
    Exception in thread "main" java.lang.Error: Unresolved compilation problem:
    What’s wrong with my code?

    - PEACE

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

    Default

    You want to do extends first:
    Java Code:
    public class Benz extends Business Logic implements Basics {
    ...
    }
    Before implementing an interface, you need to know more about the class and if there is a superclass in existence. If you say it's inherited after you implement the interface then you get an compilation error.

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

Similar Threads

  1. [SOLVED] Problem with extending classes...
    By Bizmark in forum New To Java
    Replies: 4
    Last Post: 04-08-2008, 12:21 AM
  2. Eclipse plugin extending the standard editor
    By gaspard in forum Eclipse
    Replies: 0
    Last Post: 03-04-2008, 04:23 PM
  3. implementing a button instead.
    By birdofprey in forum AWT / Swing
    Replies: 3
    Last Post: 02-18-2008, 04:21 AM
  4. implementing shape
    By sidkdbl07 in forum Java 2D
    Replies: 1
    Last Post: 01-12-2008, 07:42 PM
  5. EXTENDING the string class
    By ferno in forum New To Java
    Replies: 3
    Last Post: 12-11-2007, 10:41 PM

Posting Permissions

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