zoukankan      html  css  js  c++  java
  • scla-基础-函数-元组(0)

    //元组
    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)
      }
    }
  • 相关阅读:
    控件视图的实现原理
    建造者模式
    leetcode701
    leetcode991
    leetcode990
    leetcode989
    leetcode988
    leetcode987
    leetcode986
    leetcode985
  • 原文地址:https://www.cnblogs.com/ak23173969/p/6792387.html
Copyright © 2011-2022 走看看