042_引入变量

image-20210324092421146

package com.atguigu.chapter04.myfor

object ForVar {
  def main(args: Array[String]): Unit = {
    for(i <- 1 to 3; j = 4 - i) {
      print(j + " ")  // 3,2,1
    }

  }
}


results matching ""

    No results matching ""