Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please Help on Generic Collection

Status
Not open for further replies.

rohansr002

Programmer
Feb 19, 2010
15
IN
Hello, i am trying to create a generic array of arrayList...
but its giving error "generic array creation"...

The Code is like:

ArrayList<EmployeeDetails> [] empArray;
empArray = new ArrayList<EmployeeDetails> [3];

Don't worry abt import i did it...

please Help,

Thanks in advance !!!
 
Code:
@SuppressWarnings("unchecked")
ArrayList<EmployeeDetails>[] empArray = new ArrayList[3];
Should do the trick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top