Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How many OOP languages do you know where type-inference works

C#

Not "type-inference" in the very general sense, just "type-inference" in the "when you see 'var someVar = 3;' you can infer that someVar is of integer type" sense. Which is what java is doing again. Playing catch-up to c#.



Java is not adding local type inference as in C#. It only adds the diamond construct for inferring the generic types from the variable's type being assigned ...

Map<String, Integer> m = new HashMap<>();

Which is ugly, but many Java developers are taking "programming to an interface" rule quite literally.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: