clwn.net
当前位置:首页 >> sCAlA.mAtChError >>

sCAlA.mAtChError

一、简单例子: 1 abstract class Expr 2 case class Var(name:String) extends Expr 3 case class Number(num:Double) extends Expr 4 case class UnOp(operator : String , arg : Expr) extends Expr 5 case class BinOp(operator : String , ...

object MatchTest extends App { val weekString = Vector("星期一","星期二","星期三","星期四","星期五","星期六","星期日") import scala.io.StdIn while(true){ val line = StdIn.readLine("please input a number to get week day name, -1...

val s1="100"val r1=scala.util.Try(s1.toInt)val result = r1 match { case Success(_) => "Int" ; case _ => "NotInt" }

网站首页 | 网站地图
All rights reserved Powered by www.clwn.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com