Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6911211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:55:22+00:00 2026-05-27T08:55:22+00:00

When I compile following code in Eclipse – there are no any errors. There

  • 0

When I compile following code in Eclipse – there are no any errors.
There is only one warning:

SomeDerivedAbstractClass is a raw type. References to generic type
SomeDerivedAbstractClass should be parameterized

I tested this code in the newest Eclipse Indigo(3.7.1).
But there is following error when I tried to compile this code by javac:

SomeConcreateClass.java:1: ISomeBaseInterface cannot be inherited with different arguments: <java.lang.Object> and <>
public class SomeConcreateClass
       ^
1 error

I compiled this code suing Java 5 and Java 6. In both cases there is error.
What is wrong in this code?

public class SomeConcreateClass
   extends SomeDerivedClass
   implements ISomeInterface
{}

class SomeDerivedClass<T>
    extends SomeAbstractClass<Object>
    implements ISomeInterface
{
}

abstract class SomeAbstractClass<T> 
   implements ISomeBaseInterface<T>
{
}

interface ISomeInterface extends ISomeBaseInterface<Object> 
{}

interface ISomeBaseInterface<T>
{
}

But following code does not compile either in Eclipse or by javac:

public class SomeConcreateClass
   extends SomeAbstractClass
   implements ISomeInterface
{}

abstract class SomeAbstractClass<T> 
   implements ISomeBaseInterface<Object>
{}

interface ISomeInterface extends ISomeBaseInterface<Object> 
{}

interface ISomeBaseInterface<T>
{}

javac:

SomeConcreateClass.java:1: ISomeBaseInterface cannot be inherited with
different arguments: and <> public class
SomeConcreateClass
^ 1 error

Eclipse:

The interface ISomeBaseInterface cannot be implemented more than once
with different arguments: ISomeBaseInterface and
ISomeBaseInterface

So – is it a bug in Eclipse?
Is it the same bug as https://bugs.eclipse.org/bugs/show_bug.cgi?id=81824 ?

ONE MORE UPDATE:
This code compiles without errors both by javac and Eclipse:

public class SomeConcreateClass
   extends SomeDerivedClass
   implements ISomeInterface
{}

class SomeDerivedClass
    extends SomeAbstractClass<Object>
    implements ISomeInterface
{}

abstract class SomeAbstractClass<T> 
   implements ISomeBaseInterface<T>
{}

interface ISomeInterface extends ISomeBaseInterface<Object> 
{}

interface ISomeBaseInterface<T>
{}

There is only one difference: SomeDerivedClass is not parameterized.
I do not understand how does this influence on ISomeBaseInterface.

AND ONE MORE UPDATE:
I checked code from the first example in IntellijIDEA – this IDE shows error.
But I think it uses different approach for compilation than Eclipse.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:55:23+00:00Added an answer on May 27, 2026 at 8:55 am

    Something<> is NOT the same as Something<Object> (even though it might seem like that is reasonable).

    SomeAbstractClass<T> implements ISomeBaseInterface<T>, and SomeAbstractClass<> implements ISomeBaseInterface<> So when you use SomeDerivedAbstractClass<> (in SomeConcreateClass), you’re asking the class to implement both ISomeConcreateInterface (that is, ISomeBaseInterface<Object>) and ISomeBaseInterface<> at the same time, which it cannot do.

    You might want to use SomeDerivedAbstractClass<?>, I think.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The eclipse compiler refuses to compile the following code, stating that the field s
When I compile the following code, I only see the error during Run-time which
When trying to compile the following code, I am getting a warning that line
The following code compiles perfectly with Eclipse, but fails to compile with javac: public
When I compile the following code with g++, the object of class A seems
I am trying to compile the following code: private String dataToString(){ Map data =
I am trying to compile the following code and i am getting the error:
In preparing to a OOP exam, I enjoyed seeing g++ compile the following code
When I compile the following latex code: \begin{align} f_{m}(x) = c_{1,m} \times I(x_{i}^{m} \geqslant
The following code doesn't compile with gcc, but does with Visual Studio: template <typename

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.