A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© 飞逸 黑马帝   /  2012-2-23 15:32  /  2726 人查看  /  7 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

ReflectPoint 在我的Eclipse上怎么通行不过去啊   没有这个类。 在网吧没有截图,感激你们解答一下 。

7 个回复

倒序浏览
ReflectPoint 是自己定义的一个类吧,通不过那就是代码哪里写错咯
回复 使用道具 举报
杨曾荣 发表于 2012-2-23 16:40
ReflectPoint 是自己定义的一个类吧,通不过那就是代码哪里写错咯

能把类的方法写出来吗?
回复 使用道具 举报
你是看到反射那里的吧
回复 使用道具 举报
ReflectPoint类是张老师自己写的,如果你没有源码的话,你也自己写一个吧
回复 使用道具 举报
zhuhaowolf 发表于 2012-2-23 17:52
ReflectPoint类是张老师自己写的,如果你没有源码的话,你也自己写一个吧

我不知道怎么写  你能给我复制下吗? 内省用到的好多
回复 使用道具 举报
朱皓 中级黑马 2012-2-26 15:26:37
7#
  1. package cn.itcast.day1;

  2. import java.util.Date;

  3. public class ReflectPoint {
  4.         private Date birthday = new Date();
  5.        
  6.         private int x;
  7.         public int y;
  8.         public String str1 = "ball";
  9.         public String str2 = "basketball";
  10.         public String str3 = "itcast";
  11.        
  12.         public ReflectPoint(int x, int y) {
  13.                 super();
  14.                 this.x = x;
  15.                 this.y = y;
  16.         }
  17.        
  18.        
  19.         @Override
  20.         public int hashCode() {
  21.                 final int prime = 31;
  22.                 int result = 1;
  23.                 result = prime * result + x;
  24.                 result = prime * result + y;
  25.                 return result;
  26.         }


  27.         @Override
  28.         public boolean equals(Object obj) {
  29.                 if (this == obj)
  30.                         return true;
  31.                 if (obj == null)
  32.                         return false;
  33.                 if (getClass() != obj.getClass())
  34.                         return false;
  35.                 final ReflectPoint other = (ReflectPoint) obj;
  36.                 if (x != other.x)
  37.                         return false;
  38.                 if (y != other.y)
  39.                         return false;
  40.                 return true;
  41.         }


  42.         @Override
  43.         public String toString(){
  44.                 return str1 + ":" + str2 + ":" + str3;
  45.         }


  46.         public int getX() {
  47.                 return x;
  48.         }


  49.         public void setX(int x) {
  50.                 this.x = x;
  51.         }


  52.         public int getY() {
  53.                 return y;
  54.         }


  55.         public void setY(int y) {
  56.                 this.y = y;
  57.         }


  58.         public Date getBirthday() {
  59.                 return birthday;
  60.         }


  61.         public void setBirthday(Date birthday) {
  62.                 this.birthday = birthday;
  63.         }
  64.        
  65. }
复制代码
回复 使用道具 举报
南国 中级黑马 2014-9-25 00:49:16
8#
我查,我都有点晕,先还以为是类似内省的知识点呢?视频看的有点晕!
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马