[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" ...
随机推荐
- 结合示例说明C++中const和指针结合时怎么理解
在之前随笔<C++中const使用要点(一)>中简单叙述了const int*.int* const和const int* const的区别,记住三句话就能在实际运用时用对,但是看书时发现 ...
- 制作mysql数据快照
在建立主从关系时,如果主上有旧数据,需要将旧数据拷贝到每一个从上.下面介绍几种不同的拷贝方式. 方法一:使用mysqldump工具创建一个你想要复制的所有数据库的一个dump.这是推荐使用的方法,特别 ...
- [转][Java]语法规范
先来个 阿里的 Java 开发手册(2017.5.20 发布 v1.2.0 .pdf) 本文来自:http://blog.csdn.net/sinat_27115575/article/details ...
- c++ 双向链表操作总结
第一.包含DoubleLinkNode 模板类和DoubleLinkList 模板类 #pragma once #include<iostream> using namespace std ...
- 分类和逻辑回归(Classification and logistic regression)
分类问题和线性回归问题问题很像,只是在分类问题中,我们预测的y值包含在一个小的离散数据集里.首先,认识一下二元分类(binary classification),在二元分类中,y的取值只能是0和1.例 ...
- 使用CXF发布和调用webservice之HelloWorld入门
依赖的JAR cxf-2.2.10.jar jetty-6.1.21.jar jetty-util-6.1.21.jar servlet-2_5-api.jar ...
- 关于网格比较工具metro使用的几点注意事项
Metro作为一个非常好用的简化网格比较工具,在科研界几乎算是标准了.不过很多比较牛的作者会使用自己设计的一些比较算法,但是如果metro够用了也就不必那么麻烦了,毕竟Metro使用的方法还算是很成熟 ...
- pandas入门学习--------------------------(一)
使用pandas,首先需要熟悉它的2个主要的数据结构:Series和DataFrame. Series series是一种类似于一维数组的的对象,它由一组数据(各种Numpy数据类型)以及一组与之相关 ...
- Windbg在.net性能问题排查hang情况的应用思路
1.使用~*kb 2000 查看本地锁的callstack情况,有sleep的线程关注是否占用锁,有wait等待的线程可能是正在等待锁资源. 2.使用~*e!clrstack 查看.net的calls ...
- git之常用命令
git之常用命令 1.下载远程仓库最新代码 $ git pull --rebase origin master 2.上传代码 $ git push origin master 3.退出编辑 ESC + ...