By lokeshgupta1981
via howtodoinjava.com
Submitted: Nov 20 2012 / 10:53
Don’t you feel that Java should have a more convenient syntax for collections (lists, maps, sets, etc.). The reason I am saying this is because every time if you have you use a collection in your code then every time you have to do multiple things.
Comments
bloid replied ago:
Would be better if any of it would compile
lokeshgupta1981 replied ago:
@blood, useParamsInSomeMethod() method is symbolic in sense that you can define some method and pass expression as parameter. I thought that writing whole method will be like spoon feeding. Anyways, I will update the post.
bloid replied ago:
My point is that the first example won't compile, nor will the second, nor will the third... Never mind the missing method definition, you need add not params.add
lokeshgupta1981 replied ago:
Updated the post.
bloid replied ago:
Cool. Now only the first example won't compile instead of all 3... It's a step in the right direction
lokeshgupta1981 replied ago:
I am sorry, but i compiled and copied the code from IDE. Can you please let me know why it wouldn't.
bloid replied ago:
My mistake, I got confused by the complete lack of code indentation. All the code should compile now
lokeshgupta1981 replied ago:
Thanks for pointing out the mistakes. I really appreciate.
Voters For This Link (1)
Voters Against This Link (1)