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. 高效编程之 多线程Event

    Event 简介 Event 事件 是线程间通信的最简单方法之一,主要用于线程同步. 处理机制 定义一个全局内置标志Flag,如果Flag为False,执行到 event.wait 时程序就会阻塞,如 ...

  2. 标准库path源码解读

    先看标准库 作用:关于路径的一些实用操作 https://github.com/golang/go/blob/master/src/path/path.go 源码地址 func IsAbs func ...

  3. 2019 安洵杯 Re 部分WP

    0x01.EasyEncryption 测试文件:https://www.lanzous.com/i7soysb 1.IDA打开 int sub_416560() { int v0; // eax i ...

  4. element ui 选择期 传对象

    <template> <el-select value-key="label" v-model="value" placeholder=&qu ...

  5. ASSERT()断言

    头文件<assert.h>   作用:用于判断是否有非法的数据,有则程序报告错误,终止运行.(注意是非法情况,而不是错误情况)   ASSERT()和assert()的区别: ASSERT ...

  6. python之模块导入和包

    一.何为模块 1.一个模块就是一个包含了python定义和声明的文件,文件名就是模块名字加上.py的后缀. 2.模块目的和函数,对象等一样,是为了代码的复用性而存在的.即一个py程序写了很多功能,也可 ...

  7. MongoDB入门_MongoDB安装与配置

    MongoDB运行环境 MongoDB环境:CentOS-6.7-i386 MongoDB版本:MongoDB 2.6.5 ssh工具:xshell 文本编辑工具:vim与editplus++ 编译M ...

  8. STM32 总线

    AHB,是Advanced High performance Bus的缩写,译作高级高性能总线,这是一种“系统总线”.AHB主要用于高性能模块(如CPU.DMA和DSP等)之间的连接.AHB 系统由主 ...

  9. tp5 微信授权

    protected $appid = '****************'; //微信 appidprotected $appsecrt = '******************'; //微信 ap ...

  10. PAT Advanced 1035 Password (20 分)

    To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem ...