define simple method定义简单方法关键字def用于方法定义,在其后是方法名和可选的参数名列表,参数名列表会用一对圆括号括住。构成方法主体的代码放在参数列表之后,end用于结束方法定义。#define a methoddef factorial(n) if n0" ...
分类:
其他好文 时间:
2014-07-06 22:23:36
阅读次数:
241
有时候在操作Session时,系统会抛出如下异常java.lang.IllegalStateException: Cannot create a session after the response has been committed原因1:Session 的创建语句:HttpSession se...
分类:
编程语言 时间:
2014-07-06 20:38:38
阅读次数:
298
生成器>>> def func1():... yield 0... yield 1... >>> a=func1()>>> a.next()0>>> a.next()1>>> a.next()Traceback (most recent call last): File "", l...
分类:
编程语言 时间:
2014-07-06 20:07:34
阅读次数:
251
/**************可变参数的使用*****************///注意:可变参数一定要放在参数列表的最后,使用时是作为数组来进行操作//public static void main(String[] args) {//method("总和为:",10,50,20);//metho...
分类:
其他好文 时间:
2014-07-06 17:11:31
阅读次数:
175
Problem DescriptionI think that you might have played the traditional Chinese ring game: The Chinese Linking Rings (here we call its nickname Jiulianh...
分类:
其他好文 时间:
2014-07-06 17:06:04
阅读次数:
293
在构造函数中不要调用virtual函数,调用了也不会有预期的效果。举个例子class Transaction{ public: Transaction() { log(); } virtual void log() =0;}class BusinessTran...
分类:
编程语言 时间:
2014-07-05 20:43:00
阅读次数:
209
现在开发中的功能需要直接跳转到拨号、联系人、短信界面等等,查找了很多资料,自己整理了一下。1、跳转到拨号界面,代码如下:1)直接拨打Intent intentPhone =newIntent(Intent.ACTION_CALL, Uri.parse("tel:"+ phoneNumber));st...
分类:
移动开发 时间:
2014-07-05 20:33:22
阅读次数:
274
*&---------------------------------------------------------------------**& Report Z_BARRY_XML_CALL*&*&------------------------------------------------...
分类:
其他好文 时间:
2014-07-05 18:41:39
阅读次数:
209
1.java变长参数用...表示,如Print(String... args){ ... };
2.如果一个调用既匹配一个固定参数方法,又匹配一个变长参数方法,则优先匹配固定参数的方法
3.如果一个调用能匹配两个及以上的变长参数方法,则出现错误——这其实表示方法设计有问题,编译器会提示The method is ambiguous
4.方法只能有一个变长参数,且必须放在参数列表的最后一个...
分类:
编程语言 时间:
2014-07-04 08:32:31
阅读次数:
233
注意:前提是界面二被打开过未关闭,则用此方法即可实现在界面一中调用界面二的方法!界面一:publicclassOneActivityextendsActivity{@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_one);call..
分类:
其他好文 时间:
2014-07-04 06:00:26
阅读次数:
328