[Training Video - 4] [Groovy] Constructors in groovy, this keyword
Bank.log = log Bank b1 = new Bank()
b1.name = "BOA"
b1.minbalance = 100
b1.city="London" Bank b2 = new Bank()
b2.name = "HSBC"
b2.minbalance = 100
b2.city="LA" Bank b3 = new Bank("A",100,"X")
log.info b3.name
Bank b4 = new Bank("B",1200,"X1")
Bank b5 = new Bank("C",1300,"X2")
log.info b5.minbalance class Bank{
def static log
def name
def minbalance
def city public Bank(){ // no return type, same name with class name
log.info "inside constructor"
} // public Bank(bankName,bankMinBal,bankCity){
// name = bankName
// minbalance = bankMinBal
// city = bankCity
// } public Bank(name,minbalance,city){
this.name = name
this.minbalance = minbalance
this.city = city
}
}
Run result:
Tue Oct 06 19:51:29 CST 2015:INFO:inside constructor
Tue Oct 06 19:51:29 CST 2015:INFO:inside constructor
Tue Oct 06 19:51:29 CST 2015:INFO:A
Tue Oct 06 19:51:29 CST 2015:INFO:1300
[Training Video - 4] [Groovy] Constructors in groovy, this keyword的更多相关文章
- [Training Video - 2] [Groovy Introduction]
Building test suites, Test cases and Test steps in SOAP UI Levels : test step level test case level ...
- Error:Cannot compile Groovy files: no Groovy library is defined for module 'xxxx' 错误处理
出现 Error:Cannot compile Groovy files: no Groovy library is defined for module 'xxxx' 只要在 project str ...
- Groovy学习记录-------Groovy安装/配置
1.Groovy SDK下载 Groovy SDK官网下载地址: http://www.groovy-lang.org/download.html 每个版本有五个选项可供下载,依次为: binary ...
- [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 gro ...
- [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" ...
随机推荐
- Unit04: JavaScript 概述 、 JavaScript 基础语法 、 流程控制
Unit04: JavaScript 概述 . JavaScript 基础语法 . 流程控制 my.js function f3() { alert("唐胜伟"); } demo1 ...
- OPCDAAuto.dll 的一个坑
最近项目需要对SCADA系统的下位机采集实时数据,常见做法是两种,一种采用ModBus RTU/TCP协议直接通过支持ModBus的下位机通信,一种是通过OPC规范,使用厂商提供的OPC Server ...
- C++直接初始化和复制初始化1
这篇文章主要介绍了C++直接初始化与复制初始化的区别深入解析,是很多C++初学者需要深入了解的重要概念,需要的朋友可以参考下 C++中直接初始化与复制初始化是很多初学者容易混淆的概念,本文就以实例 ...
- CentOS 7安装chroot Named
一 安装相关软件 yum install bind-chroot bind -y 二 复制生成文件 cp -R /usr/share/doc/bind-*/sample/var/named/* /va ...
- 阻塞队列之二:LinkedTransferQueue
一.LinkedTransferQueue简介 TransferQueue是一个继承了BlockingQueue的接口,并且增加若干新的方法.LinkedTransferQueue是TransferQ ...
- python(ValueError: invalid literal for int() with base 10: 'abc' ‘1.0‘’’)强制类型转换
int()函数只能转化数字组成的字符串,看例子: >>> a=' >>> int(a) 123 >>> b='abc' >>> ...
- Macbook Pro上C++编程
Xcode新建一个c/c++程序语言工程_百度经验 http://jingyan.baidu.com/article/e2284b2b63bdede2e6118d2a.html
- mysql-5.6.17编译安装和常见问题
mysql-5.6.17编译安装和常见问题 以前用的是MySQL的5.1版本,且使用的是免编译的包,安装简单.最近换了5.6版本的MySQL,安装过程出现了不少问题. 1. 卸载原来版本的MySQL ...
- Win10怎么以管理员身份运行CMD命令提示符
[方法一] 我们可以在Windows10系统的开始菜单上,单击鼠标右键,这时候出现的菜单中,我们选择命令提示符(管理员)点击打开这样即可. 2 这样打开以后,大家可以看到命令提示符界面中显示管理员:命 ...
- Java实例变量初始化
由一道面试题所想到的--Java实例变量初始化 时间:2015-10-07 16:08:38 阅读:23 评论:0 收藏:0 [点我收藏+] 标签:java ...