When first learning something, we all want to see how it works. So, I’m going to create a quick program and run it so you can have your first bite of Scala.
In IntelliJ IDEA, right-click on the folder you want to create the class and select create new Scala class. In the next windows, make sure you select Object instead of Class
![Create a new scala object](https://datmt.com/wp-content/uploads/2022/08/image-66.png)
If you have a background in Java, you are familiar with public static void main
. The following code is the equivalent of that:
package com.datmt.scala object FirstProgram { def main(args: Array[String]): Unit = { print("Hello") } }
When you run it, the console displays “Hello” as expected.
![Running first Scala program](https://datmt.com/wp-content/uploads/2022/08/image-67.png)
That’s your first program in Scala. It’s simple, isn’t it?
![](https://datmt.com/wp-content/uploads/2023/02/1585613908477.jpeg)
I build softwares that solve problems. I also love writing/documenting things I learn/want to learn.