[Training Video - 4] [Groovy] Optional parameter in groovy
Employee.log=log
Employee e1 = new Employee() log.info e1.add(1,2,3,4)
// optional parameters in groovy
log.info e1.add(2,3)
log.info e1.add(2,3,10) class Employee {
def static log public def add(a,b,c=3,d=10){
return a+b+c+d
}
}
Run result:
Tue Oct 06 19:31:50 CST 2015:INFO:10
Tue Oct 06 19:31:50 CST 2015:INFO:18
Tue Oct 06 19:31:50 CST 2015:INFO:25
[Training Video - 4] [Groovy] Optional parameter in groovy的更多相关文章
- Groovy轻松入门——搭建Groovy开发环境
摘自: http://www.blogjava.net/BlueSUN/archive/2007/03/17/104391.html Groovy轻松入门--搭建Groovy开发环境 多日来,我发表了 ...
- Java 调用 groovy 脚本文件,groovy 访问 MongoDB
groovy 访问 MongoDB 示例: shell.groovy package db import com.gmongo.GMongoClient import com.mongodb.Basi ...
- Groovy学习()Groovy是啥?
Groovy是啥? groovy是英文中的一个单词,有marvelous.wonderful和excellen的意思. groovy是轻量级的,动态的,面向对象的,并且运行在JVM上的. groovy ...
- [Training Video - 2] [Groovy Introduction]
Building test suites, Test cases and Test steps in SOAP UI Levels : test step level test case level ...
- [Training Video - 7] [Database connection] Various databases which are supported, Drivers for database connection, SQL Groovy API
Various databases which are supported Drivers for database connection groovy.sql.Sql package SoapUI怎 ...
- [Training Video - 5] [Groovy Script Test Step - Collections, Exceptions] Exception Handling in groovy
def x = new String[3] x[0] = "A" x[1] = "B" x[2] = "C" log.info"X ...
- [Training Video - 6] [File Reading] [Groovy] Reading Properties file
Reading Properties file : Properties prop = new Properties() def path = "D:\\SoapUIStudy\\appli ...
- [Training Video - 5] [Groovy Script Test Step - Collections, Exceptions] HashSet and Hashtable
Hashset: HashSet set = new HashSet() set.add("India") set.add("USA") set.add(&qu ...
- [Training Video - 5] [Groovy Script Test Step - Collections, Exceptions] Array and ArrayList
Array: def x = new String[5] x[0] = "India" x[1] = "USA" x[2] = "Korea" ...
随机推荐
- Unit02: CSS 概述 、 CSS 语法 、 CSS 选择器 、 CSS声明
Unit02: CSS 概述 . CSS 语法 . CSS 选择器 . CSS声明 my.css p { color: yellow; } demo1.html <!DOCTYPE html&g ...
- Java 8Lambda之方法引用(Method References)
方法引用分为4类,方法引用也受到访问控制权限的限制,可以通过在引用位置是否能够调用被引用方法来判断.具体分类信息如下: 类型 使用方式 静态方法 ContainingClass::staticMeth ...
- Ui"三重天"之重温Uiaumator(1)
移动端自动化技术和接口自动化技术是接下来需要深究和拓展的两方面,基于之前的薄弱基础,重温一波,本篇内容便是android UI自动化框架Uiautomantor1. 介于对移动端自动化并没有实际应用的 ...
- PDA后台运行、安装程序
////启动最新版本安装(后台安装模式),结束更新程序 //string cabPath = @"\Application Data\QY.DDM.PDA.CAB&qu ...
- web页面取用户控件页面中服务器控件的值
用户控件页面后台: public string P_Name { get { return txt_P_name.Value; } set { txt_P_name.Value = value; } ...
- ALSA声卡11_从零编写之调试——学习笔记
1.调试 (1)把程序拷贝到服务器上进行编译 (2)把程序放到内核上面去 重新配置内核,吧原来的声卡驱动程序去掉 a. 修改语法错误 11th_myalsa b. 配置内核去掉原来的声卡驱动 -> ...
- kafka常用命令(cdh5.10.0+kafka)
参考资料:http://kafka.apache.org/quickstart 进入kafka安装目录(CDH安装路径为:/opt/cloudera/parcels/KAFKA):进入bin目录: c ...
- php redis pub/sub(Publish/Subscribe,发布/订阅的信息系统)之基本使用
一.场景介绍 最近的一个项目需要用到发布/订阅的信息系统,以做到最新实时消息的通知.经查找后发现了redis pub/sub(发布/订阅的信息系统)可以满足我的开发需求,而且学习成本和使用成本也比较低 ...
- MVC Html.DropDownList 和DropDownListFor 的常用方法
一.非强类型: Controller: ViewData["AreId"] = from a in rp.GetArea() select new SelectListItem { ...
- InfluxDB命令使用
身份验证与授权(权限管理) Authentication and Authorization 注意:身份授权与验证不能用于阻止恶意用户.如果有额外的做合理性和安全性的需求,InfluxDB可以运行在第 ...