-1

I am trying to construct a table to size of 10 that I have initialized.

private LinkedList<MapEntry<K, V>>[] table;

I have tried table = new LinkedList<MapEntry<K, V>>[]; and also table = new LinkedList<MapEntry<K, V>>()[];

None of these are working and I need help. Thanks in advance!

Suresh Atta
  • 120,458
  • 37
  • 198
  • 307
B Woods
  • 580
  • 3
  • 7
  • 21

1 Answers1

1

try this --

table  = (LinkedList<Map.Entry<K, V>>[])new LinkedList[10];

For more understanding look at the old ques

How to create a generic array in Java?

Community
  • 1
  • 1
vikrant singh
  • 2,091
  • 1
  • 12
  • 16