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 7823449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:15:00+00:00 2026-06-02T08:15:00+00:00

Isn’t it impossible to extend a generic type with an undefined type parameter ex:

  • 0

Isn’t it impossible to extend a generic type with an undefined type parameter ex:

class Foo extends enum<E>

How do they extend it?

edit: also where is the values() method defined?

Thanks in advance

  • 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-06-02T08:15:01+00:00Added an answer on June 2, 2026 at 8:15 am

    It is indeed illegal to extend a generic type with an undefined type parameter. However, enums don’t do that. If you’re decompiling some java code and saw a <E> there (And your enum type is not named E), your decompiler isn’t processing generics properly.

    An enum implicitly extends Enum<YourEnumType>. That is, implicitly the compiler generates a class YourEnumType extends Enum<YourEnumType>. By passing down its own type, it allows Enum‘s compareTo and valueOf functions to reject values from different types of enums.

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

Sidebar

Related Questions

Isn't there any way to find the class-type of a generic? if (T instanceof
Why isn't redirect working here. I'm getting call to undefined function redirect(). class Login
Isn't A a = new A(); // A is a class name supposed to
Why isn't Byte the default backing type for enumerations? Int32 seems like overkill. Every
Isn't there any built in class in PHP that has HashTable in PHP? If
Why isn't the jQuery changing the type attribute of #password_input to password? <html> <head>
Isn't -- a valid MySql comment also?
This isn't legal: public class MyBaseClass { public MyBaseClass() {} public MyBaseClass(object arg) {}
Why isn't this working? ---HTML-------- <html> <head> <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js></script> <script type=text/javascript src=j.js></script> </head>
Isn't var a keyword in C#? But why can I do this: public class

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.