Re:View of Scala from Java
by grdvnl on Friday January 04, 2013 @02:46AM
(#5006688)
Thanks, fixed the errors.
[ Parent
| on HN ]
Re:View of Scala from Java
by polymatter on Friday January 04, 2013 @06:33AM
(#5007190)
I still see under the heading 'Choose between explicit type declaration or implicit type inference' the following:
> Sum(x: Integer, u: Integer): Int = return x * y > or > Sum(x: Integer, u: Integer): = return x * y
Clearly, x * y is not the sum. And y isn't in the argument list, u is. And in both cases the return statement is unnecessary and should be omitted.