How to use scala Loop expressions
This article introduces the knowledge of "how to use scala loop expressions". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Consider the following example of a while loop adapted from Chapter 2, which uses var and is therefore imperative:
1. Def printArgs (args: Array [String]): Unit = {
2. / / var (I, j) = (0,10) multivariable assignment
3. Var I = 0
4. While (I