You need to compile a .scala file in order to run it. Below is the command to compile a .scala file,
This will generate a class file of your program with an extension .class. You need to execute this file in order to generate the output from your program. Below is the command to run a class file,
Note: you don’t need to provide .class extension for the above command.