码迷,mamicode.com
首页 >  
搜索关键字:scala提取器    ( 2个结果
第28讲:Scala提取器Extractor实战详解
提取器是从表达式中获取值第27讲中的match代码也是一种提取器defmatch_array(arr:Any)=arrmatch{ caseArray(x)=>println("Array(1):",x)//长度为1的数组,x代表数组中的值 caseArray(x,y)=>println("Array(2):",x,y)//长度为2的数组,x代表数组中的第一个值 caseArray(x,..
分类:其他好文   时间:2016-02-14 22:26:37    阅读次数:311
Scala提取器Extractor实战详解之Scala学习笔记-19
package com.leegh.pattern_match/** * @author Guohui Li */object Extractor { def main(args: Array[String]): Unit = { def match_array(arr: Any) = ar...
分类:其他好文   时间:2015-08-12 08:57:52    阅读次数:199
2条  
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!