The difference between the scala and java

(. 1) java scala and has 7 numeric types: int, short, long, byte , float, double, boolean seven kinds, but these 7 scala the value type is a class, belong to the basic type, the java in java , into the basic data types and reference types, does not distinguish Scala.
(2) type scala variables or function or variable is always written after the name of the function
(. 3) in the scala operator with the java no different operators, but in the scala, the operator is a method, in java method is not the operator, and in the scala, in addition to alphanumeric characters may be used as other special method
(. 4) in the scala wildcard is _, is the java wildcard *
(. 5) in a unit corresponding to scala java in the void
(. 6) in the scala if / else expression in the java similar, but there scala value
(. 7) scala not static, but can be used to achieve the same effect object in java, the scala object may be achieved singleton object

Transfer: https: //blog.csdn.net/u012441545/article/details/51882491

Guess you like

Origin www.cnblogs.com/xuange1/p/12233613.html