MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/49prnu/var_keyword_proposed_for_java/d0ukbi4/?context=3
r/java • u/adila01 • Mar 09 '16
312 comments sorted by
View all comments
Show parent comments
-6
Right, so I have I saved keystrokes here? I think not!
10 u/ElvishJerricco Mar 09 '16 Hm? The point is that with or without var, you have to perform the cast. Without var, it still looks like this.Class<Bar> c = (Class<Bar>) Class.forName("com.foo.Bar");With var, you get to remove a completely unnecessary type declaration. -8 u/slartybartfast_ Mar 10 '16 No, I could just say:Class c = Class.forName("com.foo.Bar")Not sure why you're blithering on about generics here.What's the point of the var keyword other than saving a few keystrokes ? 3 u/desrtfx Mar 10 '16 edited Mar 10 '16 First warning. Stay civilized.Hiding obscenities through links does not actually hide them and neither makes it acceptable practice.
10
Hm? The point is that with or without var, you have to perform the cast. Without var, it still looks like this.
var
Class<Bar> c = (Class<Bar>) Class.forName("com.foo.Bar");
With var, you get to remove a completely unnecessary type declaration.
-8 u/slartybartfast_ Mar 10 '16 No, I could just say:Class c = Class.forName("com.foo.Bar")Not sure why you're blithering on about generics here.What's the point of the var keyword other than saving a few keystrokes ? 3 u/desrtfx Mar 10 '16 edited Mar 10 '16 First warning. Stay civilized.Hiding obscenities through links does not actually hide them and neither makes it acceptable practice.
-8
No, I could just say:
Class c = Class.forName("com.foo.Bar")
Not sure why you're blithering on about generics here.
What's the point of the var keyword other than saving a few keystrokes ?
3 u/desrtfx Mar 10 '16 edited Mar 10 '16 First warning. Stay civilized.Hiding obscenities through links does not actually hide them and neither makes it acceptable practice.
3
First warning. Stay civilized.
Hiding obscenities through links does not actually hide them and neither makes it acceptable practice.
-6
u/slartybartfast_ Mar 09 '16
Right, so I have I saved keystrokes here? I think not!