zoukankan      html  css  js  c++  java
  • So the type system doesn’t feel so static.

    object wb{
            def main(args:Array[String]){
                    println("Happy everyday!DATA-CENTER!")
                    println(new java.util.Date())
            }
    object w{
            def main(args:Array[String]){
                    println("Happy everyday!")
            }
    }
    ~
    ~
    ~

     Scala集成了函数编程和对象编程的优点。

    SEAMLESS JAVA INTEROP

    Scala runs on the JVM, so Java and Scala stacks can be freely mixed for totally seamless integration.

    TYPE INFERENCE

    So the type system doesn’t feel so static. Don’t work for the type system. Let the type system work for you!

    CONCURRENCY & DISTRIBUTION

    Use data-parallel operations on collections, use actors for concurrency and distribution, or futures for asynchronous programming.

     

    TRAITS

    Combine the flexibility of Java-style interfaces with the power of classes. Think principled multiple-inheritance.

    PATTERN MATCHING

    Think “switch” on steroids. Match against class hierarchies, sequences, and more.

    HIGHER-ORDER FUNCTIONS

    Functions are first-class objects. Compose them with guaranteed type safety. Use them anywhere, pass them to anything.

  • 相关阅读:
    git clone 很慢提速方法
    在Windows上安装pytorch
    关于一些知名深度学习模型的转换
    【转】安装caffe2的参考
    Nasty Hacks
    寻梦
    Fibonacci Again
    统计元音
    首字母变大写
    查找最大元素
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6784158.html
Copyright © 2011-2022 走看看