Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
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-20-2007, 08:04 AM
Member
 
Join Date: Dec 2007
Posts: 9
ajaygargnsit is on a distinguished road
Doubt in simultaneous 'implementation' and 'extension'
////////// Start of code snippet ///////////////

interface i1
{
public void f1();
}

interface i2 extends i1
{
public void f2();
}

class c1 implements i1
{
public void f1(){}
}

// Error flashed for this class
class c2 implements i2 extends c1
{
public void f2(){}
}

///////////////////// End of code ///////////////////////////////

Now, this is what I assume ::
Since c2 is a derived class of c1, implementation of f1() must be visible in c2.

But the compiler says that implementation of f1() needs to be done.



What's wrong ??
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-20-2007, 11:01 AM
Member
 
Join Date: Dec 2007
Location: Roggwil, Switzerland
Posts: 8
daprodigy is on a distinguished road
hello

the syntax is wrong ...

class c2 extends c1 implements i2

... then, i can compile the code.

hope this helps
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-20-2007, 11:33 AM
Member
 
Join Date: Dec 2007
Posts: 9
ajaygargnsit is on a distinguished road
Thank you !!
Yeah, i did the change; it works.

Thanks again.
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
How to make delete particular extension file from a directory Java Tip java.io 0 04-05-2008 12:13 PM
Regex for file extension gapper New To Java 1 01-31-2008 05:59 PM
Eclipse Plugin Project - Extension Points JavaForums Java Blogs 0 01-28-2008 02:00 PM
Eclipse project - Extension page JavaForums Java Blogs 0 01-28-2008 02:00 PM
doubt in jms veena Enterprise JavaBeans 2 01-05-2008 03:42 PM


All times are GMT +3. The time now is 01:15 PM.


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