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

  • Home
  • SEARCH
  • 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 171267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:57:28+00:00 2026-05-11T12:57:28+00:00

Is there a difference between Enumeration<? extends ZipEntry> and Enumeration<ZipEntry>? If so, what is

  • 0

Is there a difference between Enumeration<? extends ZipEntry> and Enumeration<ZipEntry>? If so, what is the difference?

  • 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. 2026-05-11T12:57:28+00:00Added an answer on May 11, 2026 at 12:57 pm

    There’s no practical difference in terms of what you can do when you’ve got one of them, because the type parameter is only used in an ‘output’ position. On the other hand, there’s a big difference in terms of what you can use as one of them.

    Suppose you had an Enumeration<JarEntry> – you couldn’t pass this to a method which took Enumeration<ZipEntry> as one of its arguments. You could pass it to a method taking Enumeration<? extends ZipEntry> though.

    It’s more interesting when you’ve got a type which uses the type parameter in both input and output positions – List<T> being the most obvious example. Here are three examples of methods with variations on a parameter. In each case we’ll try to get an item from the list, and add another one.

    // Very strict - only a genuine List<T> will do public void Foo(List<T> list) {     T element = list.get(0); // Valid     list.add(element); // Valid }  // Lax in one way: allows any List that's a List of a type // derived from T. public void Foo(List<? extends T> list) {     T element = list.get(0); // Valid      // Invalid - this could be a list of a different type.      // We don't want to add an Object to a List<String>     list.add(element);    }  // Lax in the other way: allows any List that's a List of a type // upwards in T's inheritance hierarchy public void Foo(List<? super T> list) {     // Invalid - we could be asking a List<Object> for a String.     T element = list.get(0);     // Valid (assuming we get the element from somewhere)     // the list must accept a new element of type T     list.add(element); } 

    For more details, read:

    • The Java language guide to generics
    • The Java generics tutorial (PDF)
    • The Java generics FAQ – particularly the section on wildcards
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 117k
  • Answers 118k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer A profiler will not help you here. Neither will estimating… May 11, 2026 at 10:50 pm
  • Editorial Team
    Editorial Team added an answer Another guru told me to add this to tomcat/conf/web.xml: <mime-mapping>… May 11, 2026 at 10:50 pm
  • Editorial Team
    Editorial Team added an answer How about passing all the arguments function man() { man… May 11, 2026 at 10:50 pm

Related Questions

When comparing enums that come from different sources such as those of the following
What is the exact difference between these two interfaces? Does Enumeration have benefits over
An interview question for a .NET 3.5 job is What is the difference between
Is there a difference between NULL and null in PHP? Sometimes they seem to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.