⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 randoms.scala

📁 JAVA 语言的函数式编程扩展
💻 SCALA
字号:
import javax.microedition.lcdui._import javax.microedition.midlet.MIDletclass Test extends MIDlet with CommandListener {  def startApp {    val display = Display.getDisplay(this)        val mainForm = new Form("randoms")    mainForm append "Welcome to the world of MIDlets!"    mainForm append "(build with Scala)"    val rnd = new Random    for (i <- 0 until 10) mainForm append rnd.nextInt.toString    val exitCommand = new Command("Exit", Command.EXIT, 0)    mainForm addCommand exitCommand    mainForm setCommandListener this    display setCurrent mainForm  }  def pauseApp {}  def destroyApp(unconditional: Boolean) {}  def commandAction(c: Command, s: Displayable) {    if (c.getCommandType == Command.EXIT)      notifyDestroyed  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -