使用scala创建hello

使用scala创建hello,第1张

所使用的环境为jdk1.8.0_331scala-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

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/794457.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-06
下一篇2022-05-06

发表评论

登录后才能评论

评论列表(0条)

    保存