[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" ...
随机推荐
- JDBC--数据库链接及相关方法的封装
使用的是MySQL数据库,首先导入驱动类,然后根据数据库URL和用户名密码获得数据的链接.由于使用的是MySQL数据库,它的URL一般为,jdbc:mysql://主机地址:端口号/库名. 下面是封装 ...
- 【转】使用JMeter对数据库做压力测试
作为一名开发人员,大多情况下都会认真的做好功能测试,但是却常常忽略了软件开发之后的压力测试,尤其是在面向大量用户同时使用的Web应用系统的开发过程,压力测试往往是不够充分的.近期我在一个求职招聘型的网 ...
- crontab 定时任务设置
CRONTAB概念/介绍 crontab命令用于设置周期性被执行的指令.该命令从标准输入设备读取指令,并将其存放于“crontab”文件中,以供之后读取和执行. cron 系统调度进程. 可以使用它在 ...
- 安装FreePBX
这个我自己装完以后发现freepbx页面虽然出来了,但是还有一些错误,所以这个我就放弃了,你们可以参考上面的安装freePBX的ISO版本,跟这个是一样的,不过要新建虚拟机的 1:更新系统 yum - ...
- Spark-1.5.2安装--Standalone和Yarn
Spark Standalone 1.下载scala-2.10.6包解压到指定目录,添加环境变量 #SCALA VARIABLES START export SCALA_HOME=/usr/local ...
- IDA Pro 权威指南学习笔记(十) - 栈帧
栈帧(stack frame)是在程序的运行时栈中分配的内存块,用于特定的函数调用 如果一个函数没有执行则不需要内存,当函数被调用时就需要用到内存 1.传给函数的参数的值需要存储到函数能够找到它们的位 ...
- SSD固态盘应用于Ceph集群的四种典型使用场景
在虚拟化及云计算技术大规模应用于企业数据中心的科技潮流中,存储性能无疑是企业核心应用是否虚拟化.云化的关键指标之一.传统的做法是升级存储设备,但这没解决根本问题,性能和容量不能兼顾,并且解决不好设备利 ...
- 基于RabbitMQ的跨平台RPC框架
RabbitMQRpc protocobuf RabbitMQ 实现RPC https://www.cnblogs.com/LiangSW/p/6216537.html 基于RabbitMQ的RPC ...
- 1、svn架设、基本命令
SVN是Subversion的简称,是一个开放源代码的版本控制系统.是一项十分基础,必须能够熟练使用的工具.Apache网站:https://subversion.apache.org/ 采用C/S模 ...
- 我的Linux之路——虚拟机linux与主机之间的文件传送
出自:https://jingyan.baidu.com/article/d169e186a00422436711d872.html FTP工具或者FTP命令(put.get) 常用的工具如:Xftp ...