[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" ...
随机推荐
- JAVA-Unit04: SQL(高级查询)
Unit04: SQL(高级查询) 查看SMITH的上司在那个城市工作? SELECT e.ename,m.ename,d.loc FROM emp e,emp m,dept d WHERE e.mg ...
- 无法解析的外部符号 _WinMain@16
无法解析的外部符号 _WinMain@16 Ctrl+F7 编译的时候没有错误,而F6生成解决方案的时候出现如下两个错误: 1:error LNK2019: 无法解析的外部符号 _WinMain@16 ...
- Java Scanner 类,获取用户输入的值
Scanner 类使用步骤 1.导入java.util.Scanner import java.util.Scanner; 2.创建Scanner对象 Scanner scan = new Scann ...
- 北京师范大学第十六届程序设计竞赛决赛 C萌萌哒身高差
链接:https://www.nowcoder.com/acm/contest/117/C来源:牛客网 萌萌哒身高差 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32768K,其他 ...
- python学习(二十三) String(下) 分片和索引
分片: 记住, 是开闭区间. a = "abcdef"print(a[:])print(a[1:])print(a[:3])print(a[-2])print(a[:-2])pri ...
- XML的学习
XML是可扩展标记语言德意思,它和HTML一样都是标记语言(标签语言),不同之处在于XML可拓展,何为可拓展?在HTML中每个标签都有其特定的含义,我们不可以随便写一个标签并赋予其意义,而XML中就可 ...
- form中input是类型有哪些?
text:文本框 password:密框码 radio:单选按钮 checkbox:复选框 file:文件选择域 hidden:隐藏域 button:按钮 reset:重置按钮 submit:表单提交 ...
- 第六章 声明式服务调用: Spring Cloud Feign
我们在使用 Spring Cloud Ribbon 时, 通常都会利用它对 RestTemplate 的请求拦截来实现对依赖服务的接口调用, 而 RestTemplate 已经实现了对 HTTP 请求 ...
- CentOS7.6安装稳定版Nginx
官网地址:http://nginx.org/en/linux_packages.html#RHEL-CentOS 需先安装依赖:sudo yum install -y yum-utils 安装开始: ...
- Django学习---ajax
Ajax 应用场景:我们在输入表单进行提交的时候往往会判断输入的数据形式是否正确,这个时候如果我们点击了提交就会刷新页面.如果我们不想要它刷新页面,让它“悄悄的提交数据”,这个时候我们就需要使用aja ...