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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:00:42+00:00 2026-06-14T07:00:42+00:00

In theory, the input paramters in a subclass method should be equivaent to or

  • 0

In theory, the input paramters in a subclass method should be equivaent to or less restrictive than the input parameters of the superclass (contravariant).

What I want to do is basically create a class A that has a generic binding <T extends SomeType>, but then create a subclass B, with no generic binding (should allow any type) <T>:

    class A<T extends SomeType> {....}

    class B<T> extends A<T extends SomeType> { ..... }

Is this even possible in java or ever right from a theoretic point of view?

  • 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-14T07:00:43+00:00Added an answer on June 14, 2026 at 7:00 am

    No, that isn’t correct. Consider a method declared in A that returns T:

    abstract class A<T extends SomeType> {
    
        abstract T foo();
    }
    

    An object statically typed as A would be expected to conform to the bounds declared by that class:

    A<?> a = ...;
    SomeType someObject = a.foo();
    

    But then if B does away with those bounds:

    abstract class B<T> extends A<T> { }
    
    class C extends B<String> {
    
        @Override
        String foo() {
            return "foo";
        }
    }
    

    We have chaos:

    A<?> a = new C();
    SomeType someObject = a.foo(); // ???
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In theory, this code should set the new lock status to the users and
Ok, so I have a method that takes an NSString as input, does an
I basically understand the theory behind using the Hough Transform to detect parabolas (i.e.
Input/Output stream operators associativity in theory: LEFT TO RIGHT (for example, according to this:
Today I've been presented with a fun challenge and I want your input on
My theory might be a bit weak asking this, so feel free to let
In theory in layered architecture you can have multiple modules on the same layer.
In theory, is it more efficient to remove elements from an ArrayList or a
Information theory comes into play where ever encoding & decoding is present. For example:
In theory this seems easy but I just can't get my head around this...

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.