
所使用的环境为jdk1.8.0_331和scala-2.12.11
在scala中可以同样使用java语句,比如System.out.println("hello world")
测试代码如下:
package com.test.chapter01
object Hello {
def main(args: Array[String]): Unit = {
println("hello world")
System.out.println("hello world")
}
}
输出结果为
hello scala
hello scala
Process finished with exit code 0
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)