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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:09:08+00:00 2026-06-12T08:09:08+00:00

I was going through the Java tutorial and stumbled on something which I did

  • 0

I was going through the Java tutorial and stumbled on something which I did not understand. In the Collections trail, they talk about Wrapper implementations, there I notice two static factory methods –

public static <T> Collection<T> synchronizedCollection(Collection<T> c);

public static <T> Collection<T> unmodifiableCollection(Collection<? extends T> c);

I am wondering why does synchronized wrappers don’t use bounded wildcards? i. e. Why is the signature of synchronizedCollection not the following?

public static <T> Collection<T> synchronizedCollection(Collection<? extends T> c);
  • 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-12T08:09:09+00:00Added an answer on June 12, 2026 at 8:09 am

    Collection<? extends T> c with that you can only get stuffs but cannot add to it, which makes sense in case of unmodifiableCollection, for the method the argument should only act as producer. But in case of synchronizedCollection, it’s synchronized but still modifialbe, it should also be able to add and remove, so it has to be Collection<T> c, it should act as both producer and consumer.

    This might be helpful to know about What is PECS (Producer Extends Consumer Super)?

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

Sidebar

Related Questions

I am going through Sun's Java tutorial. I am in the lesson about sockets.
I'm going through the Java Trail on their Sound api and they described two
I was going through TypeErasure topic at http://download.oracle.com/javase/tutorial/java/generics/erasure.html which says that compiler removes all
I am going through the Java EE 6 tutorial and I am trying to
Going through the microsoft authentication tutorial listed here they have you create a master
I am going through the code which uses Predicate in Java. I have never
I'm going through the book Just Java 2 but am evidently missing something basic.
While Going through the java tutorial on sun site, I see following piece of
I am new to mongodb and as I going through the tutorial for Java
I was going through a Java tutorial where it was mentioned that actual multithreading

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.