上一页 1 ··· 5 6 7 8 9 10 11 12 13 下一页
  2010年11月15日
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#file'sname:obj_w_r.py#importcPickleaspkimportpickleaspkclassPerson:def__init__(self,name,age):self.name=nameself.age=agedefsayhi(self):print"Helloeveryone,mynameis",self.name,", 阅读全文
posted @ 2010-11-15 22:43 TroyZ 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#file'sname:using_file.pyinfo="""Mynameisnami,I'mfromHuBeiprovince,IlikeTVBtelevisionverymuch,butnowI'minCS"""filename="c:/nami.txt"#writeinfotof 阅读全文
posted @ 2010-11-15 22:41 TroyZ 阅读(223) 评论(0) 推荐(0) 编辑
  2010年11月14日
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#file'sname:inherit.pyclassSchoolMember:def__init_... 阅读全文
posted @ 2010-11-14 22:45 TroyZ 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#file'sname:MethodAndVariable.pyclassPerson:"""Thi... 阅读全文
posted @ 2010-11-14 22:42 TroyZ 阅读(825) 评论(0) 推荐(1) 编辑
摘要: 一个python文件相当于一个模块,模块都有内置的属性信息,用 dir(模块名) 可以查看, __doc__ : 模块的docstring __file__ :模块文件在磁盘上的绝对路径 __name__ :模块的名称(独立运行时值是__main__,被import时值是模块的名称)Code hig... 阅读全文
posted @ 2010-11-14 22:35 TroyZ 阅读(814) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->defsayHello(name,age=25,pwd="****0404"):print"name... 阅读全文
posted @ 2010-11-14 22:21 TroyZ 阅读(185) 评论(0) 推荐(0) 编辑
  2010年11月13日
摘要: hh -decompile htmlDir*.chm其中, 参数 htmlDir 是生成的.html文件的保存目录, *.chm是原始的chm文件。 阅读全文
posted @ 2010-11-13 11:59 TroyZ 阅读(257) 评论(0) 推荐(0) 编辑
  2010年9月21日
摘要: 1. Api----getRealPath()有的中间件,对J2EE标准的支持不一样,如:Weblogic中无法在Servlet中使用getRealPath获取资源的绝对路径。但是,我们可以使用类加载器来得到…/WEB-INF/classes/目录的绝对路径:MyServlet.class.getClassLoader().getResource(“/”).getPath();2. Api----request.getRemoteHost();获取请求的客户端的IP,如果使用了负载均衡器,则调用request.getRemoteHost()方法返回的是负载均衡器的IP,而不是客户端的实际IP, 阅读全文
posted @ 2010-09-21 03:55 TroyZ 阅读(734) 评论(0) 推荐(0) 编辑
摘要: 1. 构造函数,要放在 枚举对象 列表之后。2. 构造函数,必须是私有的。枚举测试Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->publicenumMyEnum{MON(1,"星期一"),TUE(2,"星期二");inta;Stringb;//构造函数必须私有privateMyEnum(){};privateMyEnum(int_a,String_b){this.a=_a;this.b=_b;}pub 阅读全文
posted @ 2010-09-21 03:24 TroyZ 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 1. annotation的保留策略 : @Retation(...) 参数是一个枚举类型:RetationPolicy (源文件、CLASS文件(默认)、运行时) 只有策略设置成RUNTIME时,才可以运行时期通过反射读取Annotation2. annotation的目标: @Target(...) 参数是一个枚举类型:ElementType (包、类、构造函数、方法、变量、字段、、、)3. @Retation、@Target 是 用来修饰我们自定义Annotation的Annotation(元Annotation),都可以在运行时期,通过反射读取, 所以 它俩的 @Retation都是: 阅读全文
posted @ 2010-09-21 03:18 TroyZ 阅读(401) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 下一页