这是Point类:
public class Point {
private int x;
private int y; public Point() {
x = 0;
y = 0;
} public Point(int a, int b) {
x = a;
y = b;
} public void show() {
System.out.println("坐标的值为:(" + x + "," + y + ")");
}
}
}
这是Test类:public class Test {
public static void main( String args[] ) {
Point p1 = new Point();
p1.show();

Point p2 = new Point(3,5);
p2.show();

}
}
在Test类里new Point,javac的时候出错提示cannot resovle symbol,这是什么意思?

解决方案 »

  1.   

    紫竹大哥说的是,没有编译point类,所以没有.class文件,从而出错
      

  2.   

    不应该,只要你编译了point类,再编译应该不会有错,
    你看一下你point类编译后的class的位置。
      

  3.   

    你的这两个类要在同一个包下面,如果没有在的话,你要import进来
      

  4.   

    问题得到了解决!是环境变量的问题!在PATH中应先写".;"再写其它的,原来没有".;",所以Test类在NEW Point时先到其它地方找Point了,一定是找不着的.
    所以把".;"写在前面,就会先在本目录下找!
    说得不太清楚.....