To run our Scala application, right click anywhere in HelloWorldWithArguments and select Run HelloWorldWithArguments as follows: The args variable is an Array of type String and we are leveraging the mkString function to create a command delimited String for our command line arguments.Since we extended the App trait, we have access to the args variable which holds any start up arguments for our Scala application.In our HelloWorldWithArguments, we can add the following print lines to show any command line arguments that were passed in when our Scala application starts: As explained in the previous tutorials, our HelloWorldWithArguments application extends the App trait and as such we do not have to manually write up the main function.Let us name our package .tutorial_06 and also create a new Scala object named HelloWorldWithArguments as follows: If you do not have IntelliJ installed or do not know how to create a package or Scala object, feel free to review the previous tutorials. Open IntelliJ and create a new package and Scala object In this tutorial, I will explain in more detail the run configurations that are made available in IntelliJ when we either run our Scala applications.ฤก.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |