Can java run a compiled scala code?

后端 未结 4 1011
囚心锁ツ
囚心锁ツ 2020-12-10 10:16

Can command java run a compiled scala code? If so, why do we have an exclusive command scala?

4条回答
  •  一向
    一向 (楼主)
    2020-12-10 10:55

    Yes, it can. Scala is compiled down to Java bytecode. But remember that it depends on the Scala runtime classes, so you need to still have Scala's jar files on the classpath.

    If so, why do we have an exclusive command scala?

    Convenience wrapper.

提交回复
热议问题