Scala programs can accept run-time variables as command line arguments. Here is an example of how to access the variables.
Scala provides some of its own libraries for IO, but we can also make use of the Java library. The example of reading a file uses Scala's IO package, but the file writing example uses the Java IO package.
Scala is a an object oriented functional language built on top of the Java Virtual Machine. (JVM). Because it is an extension of Java, you still have everything available to you as you normally would in Java. Check out this Hello World example.