Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-23-2007, 08:57 AM
eva eva is offline
Member
 
Join Date: Dec 2007
Posts: 49
eva is on a distinguished road
Implementing and Extending together
I have following scenario:

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:
Code:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
What’s wrong with my code?

- PEACE
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-23-2007, 04:29 PM
CaptainMorgan's Avatar
Moderator
 
Join Date: Dec 2007
Location: NewEngland, US
Posts: 839
CaptainMorgan will become famous soon enoughCaptainMorgan will become famous soon enough
Send a message via AIM to CaptainMorgan
You want to do extends first:
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.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-24-2007, 10:49 AM
eva eva is offline
Member
 
Join Date: Dec 2007
Posts: 49
eva is on a distinguished road
I tried and it worked. Thanks mate.

- PEACE
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT +3. The time now is 09:19 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org