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.

So the type system doesn’t feel so static.的更多相关文章

  1. Beginning Scala study note(8) Scala Type System

    1. Unified Type System Scala has a unified type system, enclosed by the type Any at the top of the h ...

  2. Could not load type 'System.Reflection.AssemblySignatureKeyAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c

    错误: Could not load type 'System.Reflection.AssemblySignatureKeyAttribute' from assembly 'mscorlib, V ...

  3. foreach statement cannot operate on variables of type 'System.Web.UI.WebControls.Table' because 'System.Web.UI.WebControls.Table' does not contain a public definition for 'GetEnumerator'

    错误:foreach statement cannot operate on variables of type 'System.Web.UI.WebControls.Table' because ' ...

  4. Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

    Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, ...

  5. JsonException: Max allowed object depth reached while trying to export from type System.Single

    在进行类转json字符串时,报错JsonException: Max allowed object depth reached while trying to export from type Sys ...

  6. Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute'

    [TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from as ...

  7. The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name

    可以强迫部署EntityFramework.SqlServer.dll这个文件到输出目录 找到1个老外的帖子,戳这里(本人测试无效,大家有可能试一下..) 解决方案以下: 在EF的上下文代码CS文件( ...

  8. 解决:Could not load type 'System.ServiceModel.Activation.HttpModule' from assemb

    解决:Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceMode ...

  9. 详解反射->Type.System

    反射先了解 一:system.Type 获取基本信息: Type.Name   //类名 Type.FullName //完整路径 Type.Namespace //空间名 public class ...

随机推荐

  1. 手摸手教你如何在 Python 编码中做到小细节大优化

    手摸手教你如何在 Python 编码中做到小细节大优化 在列表里计数 """ 在列表里计数,使用 Python 原生函数计数要快很多,所以尽量使用原生函数来计算. &qu ...

  2. Springboot+CAS单点登录

    一:安装CAS 下载cas:https://github.com/apereo/cas 1.1 将cas并打成war包.放入一个干净的tomcat中,启动tomcat测试: http://localh ...

  3. Kubernetes 入门-学习-nginx安装-dashboard安装

    一.入门 1.Kubernetes中文社区---http://docs.kubernetes.org.cn/ 2.Kubernetes集群组件: - etcd 一个高可用的K/V键值对存储和服务发现系 ...

  4. Spring基础16——使用FactoryBean来创建

    1.配置bean的方式 配置bean有三种方式:通过全类名(class反射).通过工厂方法(静态工厂&实例工厂).通过FactoryBean.前面我们已经一起学习过全类名方式和工厂方法方式,下 ...

  5. linux 建立 MySQL 账号

    以 root 身份登录 Linux 系统,创建 mysql 组和用户 [root@Nagios-Server ~]# groupadd mysql [root@Nagios-Server ~]# us ...

  6. Apache 的 bin 目录文件详解

    [root@Apache bin]# tree ├── ab    #Apache 性能测试工具 ├── apachectl    #Apache 启动命令,它是一个脚本 ├── apr-1-conf ...

  7. Centos 7 Mysql 最大连接数超了问题解决

    错误:Can not connect to MySQL server. Too many connections  -mysql 1040错误 这是因为对 Mysql 进行访问,未释放的连接数已经达到 ...

  8. warning MSB8030: The linker switch "Minimum Required Version" requires "SubS

    In the project properties, under Linker -> System, make sure that you set the SubSystem property ...

  9. 特殊字符(包括emoji)梳理和UTF8编码解码原理(转)

    转自:https://www.jianshu.com/p/57c27d67a8a8 背景知识 emoji表情符号,是20世纪90年代由NTT Docomo栗田穣崇(Shigetaka Kurit)创建 ...

  10. [人工智能]IBM Watson人工智能API|一步步创建智能微信翻译官|第一章

    最近参加了IBM可认知内部创业活动,想从零创建一个微信翻译工具,这就是我的AI翻译官.