Scala keyboard input

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/chen18677338530/article/details/91437018

Introduction

In programming, the user needs to receive the data entered on the keyboard input needed.

import scala.io.StdIn

object Demo6 {
  def main(args: Array[String]): Unit = {
    println("请输入姓名:")
    val name:String = StdIn.readLine()

    println("您的姓名是:"+name)
  }
}

Here Insert Picture Description

Guess you like

Origin blog.csdn.net/chen18677338530/article/details/91437018