浙江省高等学校教师教育理论培训

微信搜索“毛凌志岗前心得”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年12月23日

摘要: 2011-09-30Java子类与父类的初始化 博客分类:androidJava代码 classParent{ intx=10; publicParent(){ add(2); } voidadd(inty){ x+=y; } } classChildextendsParent{ intx=9; voidadd(inty){ x+=y; } publicstaticvoidmain(String[]args){ Parentp=newChild(); System.out.println(p.x); } }class Parent{ int x=10; ... 阅读全文
posted @ 2011-12-23 09:04 lexus 阅读(1021) 评论(0) 推荐(0)

摘要: http://mht.iteye.com/blog/170350Java中static块 博客分类:java技术JavaJava 程序中时常用些 static {} 这样的结构。 这样的结构叫 static块 ,一般是一个类初始化时运行的代码。 注意,是类的初始化,不是对象的初始化。 也就是你在定义对象是,它运行的初始化代码,并且只有第一次定义时才运行。之后就不再运行初始化了。 一个类中可以可以有很多static块。static块按顺序执行。看以下代码:public class TestStatic{static{ System.out.println(1);} static{ System. 阅读全文
posted @ 2011-12-23 08:57 lexus 阅读(639) 评论(0) 推荐(0)

摘要: http://blog.csdn.net/hlantian/article/details/5276597http://www.cnblogs.com/gxinliug/archive/2011/04/26/2029788.htmlhibernate 中 get、load 的 区别 分类: 知识点 2010-02-01 11:48 1999人阅读 评论(0) 收藏 举报 转自:http://blog.163.com/love-love-l/blog/static/210783042009618919985/#comment=fks_0830700850950800690810940830950 阅读全文
posted @ 2011-12-23 08:54 lexus 阅读(267) 评论(0) 推荐(0)