How does the scala REPL work when defining a class?

守給你的承諾、 提交于 2019-12-13 17:22:07

问题


If I open the Scala REPL, I noticed I can create classes.

My questions are:

  • What does the REPL do when there is a class definition?
  • Does it compile the class?

回答1:


The REPL is not an interpreter in the usual sense, as it never executes code directly. Code that you enter in the REPL is always compiled and so are class definitions.



来源:https://stackoverflow.com/questions/12712254/how-does-the-scala-repl-work-when-defining-a-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!