• Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing Generic Array to a method  RSS feed

 
Stribor Kab
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read somewhere that you can not pass generic array as a method parametar yet I found it here..



in this link Java tutorial
 
Stephan van Hulst
Saloon Keeper
Posts: 7973
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I guess wherever you read that was wrong.
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell us where you read the bit about not passing generic arrays, so we can see whether you have understood it correctly. Remember you cannot create an array of a generic type: the following shouldn't compile:-
List<String>[] lists = new ArrayList<String>[3];
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!