自定义包时出现的问题package com.juj;public class Point{ private int x,y; public Point() {} public Point(int x,int y) {this.x=x;this.y=y;} public void setx(int a) {x=a;} public int getx() {return x;} public void sety(int a) {y=a;}

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 13:27:11
自定义包时出现的问题package com.juj;public class Point{  private int x,y;  public Point()   {}  public Point(int x,int y)  {this.x=x;this.y=y;}  public void setx(int a)   {x=a;}  public int getx() {return x;}  public void sety(int a) {y=a;}
xT]OP+'\i$Ź̋Lw˱,Gm 1APf:Mt4ٖ"W ;= X4=>O<9!qʟjYח_8_7fyޭG{"8 BIA1= &GYDd2~%H"n-d绂nVH>f8Ʉ3A_ŀ̢ AJ Î 'w AVbQZAdOK5p=Bp{%½<,]Խ -/S~Zu)N yY2jV[W"QWcpؾ_΢O##f~3<IHl*ʺf%R !OyG43ro2k,9~` IP˯^zma}9J'y>v)FH#oW(y])D5io-N>cJZN͎}kkyyΚgk ̛OVm}Εf^ZɩʕOpү+X-D&ʊx2YH,8& 8Rx=ξ}.؄$ S22g8p\= æk׊U\8p%Z[U2BŨ7q}۪UڲQ)"nUbjOPd:

自定义包时出现的问题package com.juj;public class Point{ private int x,y; public Point() {} public Point(int x,int y) {this.x=x;this.y=y;} public void setx(int a) {x=a;} public int getx() {return x;} public void sety(int a) {y=a;}
自定义包时出现的问题
package com.juj;
public class Point
{
private int x,y;
public Point() {}
public Point(int x,int y) {this.x=x;this.y=y;}
public void setx(int a) {x=a;}
public int getx() {return x;}
public void sety(int a) {y=a;}
public int gety() {return y;}
}这是我定义包的源代码放在c:\jdk1.6.0_02\jre\classes下面的
import com.juj.Point;
public class MDPoint2
{
public static void main(String args[])
{
Point a=new Point();
Point p=new Point(3,5);
p.setx(6);
System.out.println("P 点间的x,y坐标为:"+p.getx()+","+p.gety());
System.out.println("a 点间的x,y坐标为:"+a.getx()+","+a.gety());
}
}这是我写的一个引用上面包的类的一个程序 编译时都通过了 运行的时候
java MDPoint2以后
Exception in thread "main" java.lang.NoClassDefFoundError:com/juj/Point at MDPoint2.main实在不知道怎么办了 各位大虾帮帮忙

自定义包时出现的问题package com.juj;public class Point{ private int x,y; public Point() {} public Point(int x,int y) {this.x=x;this.y=y;} public void setx(int a) {x=a;} public int getx() {return x;} public void sety(int a) {y=a;}
你应该先搞清楚包的概念
理解清楚后,你这里只要把你编译好的Point.class放在目录c:\jdk1.6.0_02\jre\classes\com/juj下面就可以了