博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
scla-基础-函数-元组(0)
阅读量:7069 次
发布时间:2019-06-28

本文共 889 字,大约阅读时间需要 2 分钟。

//元组class Demo2 extends TestCase {    def test_create_^^(){      val yuana = (1,true,1.2,"c","phone")        val v1 = yuana._1      val v2 = yuana _2 ;      val y1 = test_return_yuanzu()       val k1 = y1._1      println(test_return_yuanzu3(3, 4, 4))            test_return_yuanzu4(ma)      test_return_yuanzu4((K:Int,y:Double,c:String)=>{         println("scala 匿名函数 玩的不是一条道啊")          println("java是怎么搞定它的")          println("关键是如何在java中配合scla开发了")          println("scala太自由了")       })  }        def test_return_yuanzu():(Int,Int)={      (10,10)  }    def test_return_yuanzu2():(Int,String,String) = (1,"2","2")      def test_return_yuanzu3(x:Int,y:Int,c:Int):(Int,String,String) = (x+y+c,"2","2")      def test_return_yuanzu4(ma:(Int,Double,String)=>Unit){ma(1,2,"")}      def ma(x:Int,y:Double,k:String){      println(x+y+k)  }}

 

转载于:https://www.cnblogs.com/ak23173969/p/6792387.html

你可能感兴趣的文章
golang使用oracle碰到go/lib/time/zoneinfo.zip: no such file or directory
查看>>
quartz定时任务时间设置描
查看>>
ES6常用语法
查看>>
https://www.jianshu.com/p/dbffae16ba0b
查看>>
微信,QQ这类IM app怎么做——谈谈Websocket
查看>>
在Ubuntu 11.04中安装Openresty
查看>>
JAVA常见的面试题
查看>>
《Python高效开发实战》实战演练——建立应用2
查看>>
java: -source 1.6 中不支持 switch 中存在字符串.....
查看>>
Confluence 6 空间
查看>>
lua-resty-http上传数据
查看>>
heartbeat+ldirectord实现web与dns的高可用性
查看>>
luacurl安装
查看>>
JBoss的配置
查看>>
软件测试之Web实战测试
查看>>
Tomcat的参数配置及一般问题的解决
查看>>
JAVA CAS原理深度分析
查看>>
O2O?啥是“呕吐呕”?
查看>>
百度的疯狂 UC的隐忍
查看>>
我的友情链接
查看>>