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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:08:45+00:00 2026-06-10T23:08:45+00:00

I am new to java language and have been reading over the API documentations.

  • 0

I am new to java language and have been reading over the API documentations. I was wondering if someone could help me with what some of the symbols mean? For example, in PriorityQueue there is:

Constructor Summary
...
PriorityQueue(Collection<? extends E> c)
...

Method Summary
...
<T> T[]
...

My problem is around ‘?’, ‘E’, ‘c’ and ‘T’. I think I have worked out a few, like ‘T’ I think is Type. If someone could help with understanding I would be much greatful. A link to website that describes would be great! Thank you!

  • 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-10T23:08:47+00:00Added an answer on June 10, 2026 at 11:08 pm

    You’re right that T is a type parameter. In this case it can be replaced by any type, since it does not have constraints.

    This constructor has a type constraint:

    PriorityQueue(Collection<? extends E> c)
    

    and should be read as: create a new PriorityQueue instance using a Collection taking as type parameter any type that extends the type E (including E itself), where E is the type parameter of the PriorityQueue. Example:

    List<String> list = new ArrayList<String>();
    PriorityQueue<String> pq = new PriorityQueue<String>(list);
    

    In this case E (the type parameter of pq) is String and the type parameter of list matches the predicate ? extends E, since it is also String.

    This would also work:

    List<String> list = new ArrayList<String>();
    PriorityQueue<Object> pq = new PriorityQueue<Object>(list);
    

    since String is a subclass of Object, but this would fail at compilation:

    List<String> list = new ArrayList<String>();
    PriorityQueue<Integer> pq = new PriorityQueue<Integer>(list);
    

    I suggest you read more about Java generics here.

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

Sidebar

Related Questions

I've been doing some reading about two (relatively) new concepts in the Javascript language
Okay, so I have been developing in Java for a little over a year
I'm new to Java and have been asked to create an applet/servlet (not sure
Hey everyone! I am new to blackberry programming although I do have some java
i am still new to the Java language and libraries... i often use this
I've recent been reading about immutable strings Why can't strings be mutable in Java
I have been playing around with Scala parser combinators for some time now, and
I have been dealing with a problem for some time and would really appreciate
In last few months I have been making a transition from Java to Groovy
I have been using WPF for a new project which is far from done.

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.