Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Warning#

Sumit Rawal answered on May 23, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers


Warning#

0

While the above code gives the correct output, it also gives a warning. This is because we are calling the main method. A standalone object which acts as an application should not be called using EntryApplication.main(inputArray). This is because, as in most programming languages, main does not need to be called as it is automatically called when running the script it is contained in.

Suppose your ChecksumAccumulator class and object are written in a script named main.scala and EntryApplication is written in a separate script with the name test.scala. Traditionally, you would run the Scala script using the following command.

1

scalac main.scala test.scala

scalac is a Scala compiler. You use this to run main.scala and test.scala. Running the command above will result in .class files for each class and singleton object in the given .scala files.

After this, all you would have to do is write the string whose checksum you want to be calculated on the command line. The string should be preceded by the standalone object which calls the main method. In our case, that object is EntryApplication.

Popularity 1/10 Helpfulness 1/10 Language scala
Source: Grepper
Tags: scala
Link to this answer
Share Copy Link
Contributed on May 23 2023
Sumit Rawal
0 Answers  Avg Quality 2/10


X

Continue with Google

By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
X
Grepper Account Login Required

Oops, You will need to install Grepper and log-in to perform this action.