- package javaAdvanced;
- /**
- * 类的描述信息
- * 反射信息的测试类
- *
- * @author cuiH
- * Date: 13-12-2
- */
- public class ReflectPoint {
- private int x;
- public int y;
- public String str1 = "football";
- public String str2 = "basketball";
- public String str3 = "pingPang";
- public ReflectPoint(int x, int y) {
- this.x = x;
- this.y = y;
- }
- @Override
- public String toString() {
- return super.toString();
- }
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof ReflectPoint)) return false;
- ReflectPoint that = (ReflectPoint) o;
- if (x != that.x) return false;
- if (y != that.y) return false;
- return true;
- }
- @Override
- public int hashCode() {
- int result = x;
- result = 31 * result + y;
- return result;
- }
- }
复制代码 |
|