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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:48:30+00:00 2026-06-09T13:48:30+00:00

Class<? extends Integer> will compile fine, but Integer is a final type so it

  • 0

Class<? extends Integer> will compile fine, but Integer is a final type so it doesn’t make sense to use it as an upper bound (nothing will ever extend it).

If you try to use a final type as an upper bound for a type parameter, you will get a compiler warning:

The type parameter T should not be bounded by the final type Integer.
Final types cannot be further extended

Why would using a final type as an upper bound for a wildcard be perfectly fine, but throw a warning for a type parameter? Why does Java even allow for wildcards to be bounded by a final upper type?

  • 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-09T13:48:31+00:00Added an answer on June 9, 2026 at 1:48 pm

    Class<Integer> is not as permissive for assignment as Class<? extends Integer>.

    For example, this compiles:

    Class<? extends Number> numberClass = Integer.class;
    Class<? extends Integer> integerClass = numberClass.asSubclass(Integer.class);
    

    This doesn’t:

    Class<? extends Number> numberClass = Integer.class;
    Class<Integer> integerClass = numberClass.asSubclass(Integer.class);
    

    Myself, I couldn’t get a compiler warning as you do (perhaps you could provide an example and details on your compiler?).

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

Sidebar

Related Questions

public class HttpPostTask extends AsyncTask<Void, Integer, Void> { TextView txtStatus = (TextView)findViewById(R.id.txtStatus); @Override protected
public static class TestTask extends AsyncTask<Void, Integer, Integer> { private String stacktrace; public TestTask
public class MyFrame extends JFrame { public MyFrame(String title) { setSize(200, 200); setTitle(Integer.toString(super.getSize().width)); setLayout(new
I have a class extends NamedParameterJdbcDaoSupport. well this superclass has a final setDataSource method
@Entity @Table(name = parent) public final class Parent extends Base { @OneToOne(cascade = CascadeType.PERSIST,
This is my MySqlLiteHelper: public class MySQLiteHelper extends SQLiteOpenHelper { public static final String
Here is my AsyncTask class: private class Task extends AsyncTask<Void, Integer, Void> { @Override
This class extends Thread and once it is created, the thread is started. This
My class extends View and I need to get continuous touch events on it.
i have a class extends asynctask private class taskMK extends AsyncTask<Void,Void,JSONObject>{ String url; JSONObject

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.