Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
scala是一个简单的while循环错误 对象jdwileloop { def main(参数:数组[字符串]) { var指数:Int=0 while(index_Scala_While Loop - Fatal编程技术网

scala是一个简单的while循环错误 对象jdwileloop { def main(参数:数组[字符串]) { var指数:Int=0 while(index

scala是一个简单的while循环错误 对象jdwileloop { def main(参数:数组[字符串]) { var指数:Int=0 while(index,scala,while-loop,Scala,While Loop,这是格式错误。这应该可以: object JDWhileLoop { def main(args: Array[String]) { var index:Int = 0 while( index<=10) {

这是格式错误。这应该可以:

object JDWhileLoop
{               
                def main(args: Array[String])

                {
                        var index:Int = 0
                        while( index<=10)
                        {

                        println("index="+index)
                        index= index+1              

                        }

                }       
}                   

这是格式错误。这应该可以:

object JDWhileLoop
{               
                def main(args: Array[String])

                {
                        var index:Int = 0
                        while( index<=10)
                        {

                        println("index="+index)
                        index= index+1              

                        }

                }       
}                   

在Scala中确实应该避免使用C样式{}。这甚至不是样式问题,而是安全问题。在Scala中确实应该避免使用C样式{}。这甚至不是样式问题,而是安全问题。
def foo (args: Bar) {
  //some work 
}