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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:18:09+00:00 2026-06-10T13:18:09+00:00

This is something I should know, but I’m drawing a blank on it and

  • 0

This is something I should know, but I’m drawing a blank on it and am having a surprising amount of difficulty trying to find the answer with google.

I’m trying to extend a Java Collection, specifically the ConcurrentHashMap. I want to create my own hash map class for use with non-generic key/value pairs, specifically using my own classes.

So I’ve defined the class as such:

public class hashMap extends ConcurrentHashMap<class1, class2>

The issue is I’m forgetting how to properly write the constructor(s) so that they’re non-generic. For instance, with the original concurrentHashMap, you have to call its constructor specifying the classes for the key/value pairs. I want to just simply be able to call the constructor hashMap(), without needing to specify those generics.

I’ve tried calling super<class1, class2>(); in the constructor, but that gave me an error.

This seems like it should be something very simple, and I’m positive I used to know how to do this, but it’s been a while and like I said I’m drawing a blank.

Thanks.

  • 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-10T13:18:10+00:00Added an answer on June 10, 2026 at 1:18 pm

    Just plain super(); will work—or nothing at all, since it is implied. Remember that new HashMap<String,Integer>(); is not really a constructor invocation in the same sense of a method invocation: it is the specification of the type to instantiate + constructor arguments. The constructor itself does not receive the type arguments, they are there only as call-site type information.

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

Sidebar

Related Questions

This is something that I'm sure I should know the answer to, but either
this is probably something I should know, but I'm puzzled by this. I'm trying
I feel like this is something I should already know, but I'm just not
This is something stupid I probably should know, but Googling fails me: When compiling
I feel that this is something I should know, but does a java agent
This is something I should really know, but I haven't done any db work
I should know the answer to this, but I don't: if you try to
I get the feeling this is probably something I should know but I can't
This seems like it should be something I already know. We need to run
This seems like it should be something very easy to do, but every time

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.