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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:13:26+00:00 2026-05-28T20:13:26+00:00

I have a class defined like so: public class AddRecordsToolbar<D extends IDataSource<T>, T extends

  • 0

I have a class defined like so:
public class AddRecordsToolbar<D extends IDataSource<T>, T extends Serializable>
extends AbstractToolbar<D, T>

which my IDE IntelliJ IDEA declares as legal. It looks and feels wrong to me.
I want to declare it like this:
public class AddRecordsToolbar<D extends IDataSource<T extends Serializable>, T>
extends AbstractToolbar<D, T>

however that syntax is illegal thanks to something to do with Javas type erasure.

D extends IDataSource<T> is required by the superclass.
My Class is using Serializable to do a deep copy. Hence the T extends Serializable.

So now on to the Question: If I specify T extends Serializable as the second type parameter for my class will it still enforce T extends Serializable for D as well?

  • 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-28T20:13:27+00:00Added an answer on May 28, 2026 at 8:13 pm

    Answering to your question, yes its do.

    The order of generic parameter it only in your mind.

    If we would rephrase that implementation to:

    public class AddRecordsToolbar<T extends Serializable, D extends IDataSource<T>> extends AbstractToolbar<D, T>
    

    you will be not so surprised, and looks that the way it should be.

    I will try to find the explanation for this in Java Language Specification (when it will work) but for now that the way it is.

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

Sidebar

Related Questions

I have a custom listView defined like this public class DDListView extends ListView implements
I have a class called MainGame, which is defined like this in my .h:
In my application I have a class which has properties of user-defined types like
I have some logic, which defines and uses some user-defined types, like these: class
I have a class Foo defined like this: class Foo { public: Foo(int num);
For example, imagine I have an object defined like so: public class Example {
Okay, let's say we have a class defined like public class TestClass { private
I have custom attribute defined like so: [AttributeUsage(AttributeTargets.Field)] public class EnumDisplayAttribute : Attribute {
I have a class defined like so: public class Test { static <T> List<Class<T>>
I have an example class defined like below: public class FooBar { void method1(Foo

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.