Detailed explanation of scala applet and example code

Detailed explanation of scala applet

1. interactive mode

In the command line window, enter the scala command:

First applet:

2. Script mode

First applet in script mode:

Let's see how to save the file, compile and run the program. Follow the steps below:

(1) Save the code as test. Scala

(2) Open a command window, and then go to the directory where you saved the program file, which is / home / Xiaosi / test

(3) Compile

The above command will generate several class files in the current directory:

One of the names is test Class, which is a bytecode that can run in the Java virtual machine (JVM)

(4) Run

You can see Hello Apple output

Thank you for reading, hope to help you, thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>