java - Declaring Linked Lists of a certain data type? -


sup guys reading things linked lists , stumbled along question:
following valid or invalid statement? explain answer. (we can assume using generics)

linkedlist <int> thelist = new linkedunorderedlist <int> (); 

** think it's valid statement because autoboxing occurs when declare int put list. meaning int becomes object of type int.

just want check of here if correct.or understanding of off.

you incorrect.

java generics work on objects. since int primitive not work.

as auto unboxing, occurs integer type when try , place int in int.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -