-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
  • 114,879
  • 36
  • 179
  • 284
B Woods
  • 595
  • 2
  • 6
  • 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,013
  • 1
  • 10
  • 15