Using var in this case doesn't make any sense.
-
-
-
Why you think so? I often hear that we should use var only in methods. In this case it‘s clear that the method returns an int so inside the method we can use a var without harming the readability of it. Can you clear my mind? :)
- 1 more reply
New conversation -
-
-
Can I point out how var makes code less readable. I recently cloned some code down to check for defects... so many vars in use that it took me 6 methods of back tracking to find the data type of each variable.
-
Exactly. Having the information about variable's type right in front of my nose is a feature, not a bug. Not sure why Java went this way.
- 1 more reply
New conversation -
-
-
Wasn't TimeUnit invented for this kind of conversion?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
Show additional replies, including those that may contain offensive content
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.