2016年10月21日

摘要: 1 package jxlPacakge; 2 3 public class Object_num { 4 public static void main(String[] args) { 5 // TODO Auto-generated method stub 6 Roo obj1=new Roo(); 7 Roo ... 阅读全文
posted @ 2016-10-21 11:47 杨寒 阅读(217) 评论(0) 推荐(0) 编辑
 
摘要: 在静态方法中,先生成一个对象,用对象.成员访问实例成员 static class Employee { String name; long salary; short employee_id; static int total_employees; static void clear(){ Empl 阅读全文
posted @ 2016-10-21 11:18 杨寒 阅读(609) 评论(0) 推荐(0) 编辑
 
摘要: package jxlPacakge; class Root{ static{ System.out.println("Root的静态初始化块"); } { System.out.println("Root的普通初始化块"); } public Root() { System.out.println 阅读全文
posted @ 2016-10-21 11:02 杨寒 阅读(162) 评论(0) 推荐(0) 编辑
 
摘要: 1-1程序代码: package jxlPacakge;public class ObjectEquals { public static void main(String[] args) { MyTestClass obj1=new MyTestClass(100); MyTestClass ob 阅读全文
posted @ 2016-10-21 10:46 杨寒 阅读(127) 评论(0) 推荐(0) 编辑
 
摘要: class MyTestClass { public int Value; public boolean equals(MyTestClass obj){ return obj.Value ==this.Value; } public MyTestClass(int initValue){ Valu 阅读全文
posted @ 2016-10-21 10:25 杨寒 阅读(234) 评论(0) 推荐(0) 编辑