As a simple rule, beginner Scala programmers should try to omit type declarations which seem to be easy to deduce from the context, and see if the compiler agrees.

 
  • 对于初学者,可以遵循这样一条原则:当上下文看起来比较容易推导出数据类型时,就应该忽略类型声明,并尝试是否能够编译通过,不行就修改。
今日热词
目录 附录 查词历史