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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:43:43+00:00 2026-06-13T11:43:43+00:00

According to the Generics trial , This section states: Given two concrete types A

  • 0

According to the Generics trial,

This section states:

Given two concrete types A and B (for example, Number and Integer), MyClass<A> has no relationship to MyClass<B>, regardless of whether or not A and B are related. The common parent of MyClass<A> and MyClass<B> is Object.

Yet, here we’re told,

Although Integer is a subtype of Number, List<Integer> is not a subtype of List<Number> and, in fact, these two types are not related. The common parent of List<Number> and List<Integer> is List<?>.

Why isn’t the parent of MyClass<A> / MyClass<B> in the first example MyClass<?>? What is the distinction?

  • 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-13T11:43:44+00:00Added an answer on June 13, 2026 at 11:43 am

    I think the answer is rather trivial. While the correct parent of MyClass<A> and MyClass<B> is indeed MyClass<?>, the tutorial did a small simplification there, as wildcards have not been introduced yet.

    The point of saying

    The common parent of MyClass<A> and MyClass<B> is Object.

    was just to make it clear that none of the two types is the parent of the other, regardless of the relationship between A and B.

    This is confirmed by the following comment right below your first quote:

    For information on how to create a subtype-like relationship between two generic classes when the type parameters are related, see Wildcards and Subtyping.

    as well as by the introduction of the chapter Wildcards and Subtyping:

    As described in Generics, Inheritance, and Subtypes, generic classes or interfaces are not related merely because there is a relationship between their types. However, you can use wildcards to create a relationship between generic classes or interfaces.

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

Sidebar

Related Questions

According to the section here on generic types: http://msdn.microsoft.com/en-us/library/dd233230.aspx then these forms are equivalent:
According to this entry in the Java Generics FAQ , there are some circumstances
I have a generic question, and specific example. This should be easy according to
According this article , generic JPA DAO(Data Access Object) is a pretty nice pattern.
According to this SO post: How to check the TEMPLATE_DEBUG flag in a django
According to this post , IDEA uses Osmorc to run OSGi frameworks. It, in
According to this post in Recursive Descent vs. LALR , any LALR(k) can be
In Java, am I able to extend from a generic supertype? According to this
I am reading Thinking in java , Generics. In one example(at paragraph The action
According to this question's answer : According to the standards you must define i

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.