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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:49:08+00:00 2026-05-20T15:49:08+00:00

in Combinator class: public static <KEY, T> void getCombsIntoTreeMap(int N, int K, TreeMap<KEY, T>

  • 0

in Combinator class:

public static <KEY, T> void getCombsIntoTreeMap(int N, int K,  
                                           TreeMap<KEY, T> map, 
                                           Class<? extends KEY> keyIstance, 
                                           Class<? extends T> valueIstance)
{...}

and in Comp class;

TreeMap<Hand, int[]> mappa = new TreeMap<Hand, int[]>();  
int[] keyIstance = new int[2];  
Hand valueIstance = new Hand( new int[]{0} );  
Combinator.getCombsIntoTreeMap(53, 5, mappa, 
                               keyIstance.getClass(), 
                               valueIstance.getClass() ); 

;

the compiler just says:

Comp.java:85:  <KEY,T>getCombsIntoTreeMap(int,int,java.util.TreeMap<KEY,T>,java.lang.Class<? extends KEY>,java.lang.Class<? extends T>) in Combinator cannot be applied to (int,int,java.util.TreeMap<Hand,int[]>,java.lang.Class<capture#86 of ? extends int[]>,java.lang.Class<capture#138 of ? extends Hand>)
    Combinator.getCombsIntoTreeMap(53, 5, mappa, keyIstance.getClass(), valueIstance.getClass() );
              ^

I need help.
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-05-20T15:49:09+00:00Added an answer on May 20, 2026 at 3:49 pm

    Well your Map instance has the type parameter list <KEY, T>, and your function wants the “KEY” class first and the “T” class second, but you’re passing the classes into the function in the wrong order.

    In other words, your map is declared with the “KEY” being “Hand” and the value being “int[]”, but your “keyIstance” (should be “Instance” by the way) has type int[] and that seems backwards.

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

Sidebar

Related Questions

Given: public interface PrimaryKey<Key extends Comparable> { Key getKey(); } and public class PrimaryKeyComparator
Is there any way to make a code like this work: public class Func2<A,
Here is a sample of code that annoys me: class Base { protected: virtual
I'm having a problem with the AsyncTask class. It seems like my task stops
I'm trying to make an enum of strings. Here's what I've got so far,
I am trying to implement a subset of Java for an academic study. Well,
This is my goal: I need to two (or more) Areas for my MVC
My code is basically allocation free, however the GC runs every 30 seconds or
I am trying to understand which implementation below is faster. Assume that one compiles
I am trying to make an iPhone app that uses OpenCV plus another C++

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.