[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" ...
随机推荐
- RTMP(实时信息传输协议)详解
RTMP协议是Real Time Message Protocol(实时信息传输协议)的缩写,它是由Adobe公司提出的一种应用层的协议,用来解决多媒体数据传输流的多路复用(Multiplexing) ...
- Django 的路由分配系统
Django的路由系统 URL配置(URL.conf)就像Django所支撑网站的目录,它的本质是URL与要为该URL调用的视图函数之间的映射表. 我们就是以这种方式告诉Django,遇到哪个URL的 ...
- Java 静态对象 static
什么是静态变量 大家都知道,我们可以基于一个类创建多个该类的对象,每个对象都拥有自己的成员,互相独立. 然而在某些时候,我们更希望该类所有的对象共享同一个成员.此时就是 static 大显身手的时候了 ...
- Linux系统性能检测
转自:http://www.cnblogs.com/itech/archive/2011/06/08/2075145.html 一 .uptime uptime命令用于查看服务器运行了多长时间以及有多 ...
- 第二章:Android Studio概述(一)[学习Android Studio汉化教程]
Android Studio是一个视窗化的开发环境.为了充分利用有限的屏幕空间,不让你束手束脚,Android Studio 在特定的时间仅仅显示一小部分可用窗口. 除了一些上下文敏感的窗口和上下文 ...
- Python,OpenGL生命游戏
初学Python和OpenGL,练手的第一个小程序life.py,这个小程序在日后会不断调整,增加类.优化判断及操作 执行效果: 按正规生命游戏的规则: 1.周围生命等于3时产生生命 2.周围生命等于 ...
- Spring高级话题
Spring Aware 在实际项目中,你不可避免的要用到spring容器本身的功能资源,这时你的bean要意识到spring容器的存在,才能调用spring提供的资源.spring aware本来就 ...
- leetcode36
public class Solution { public bool IsValidSudoku(char[,] board) { ; i < ; i++) { var dic = new D ...
- centos7 yum 安装 mysql
CentOS7默认数据库是mariadb,配置等用着不习惯,因此决定改成mysql,但是CentOS7的yum源中默认好像是没有mysql的.为了解决这个问题,我们要先下载mysql的repo源. 1 ...
- Setup Apache2 in Debian 9 and enable two ports for two sites
root@debian:~# apt-get install apache2 root@debian:~# cd /etc/apache2/ root@debian:/etc/apache2# ls ...