java - What is the difference of the List declaration? -


this line reports methods of load load.getid():

list<load> dbrecs = dblist.getallloads(); 

whereas line reports incremental hex address

list dbrecs = dblist.getallloads(); log.d("load", dbrecs); 

now project can move along.

is first line posting correct because supplied correct structure list declaration of list<load>? plow forward want short definitive answer or specific doc link.

the first declaration employs generics. it's syntactic sugaring allows declare list of loads, , not other odd object, , have compiler prevent adding integers or strings there mistake. allows save hassle , load objects directly instead of having mess around casts.

if possible, using generics considered best practice.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -