[英]Compiling java code error
當我要編譯名為SetPoint.java的文件時,出現錯誤:
SetPoint.java:5: error: cannot find symbol
Point point = new Point();
^
symbol: class Point
location: class SetPoint
SetPoint.java:5: error: cannot find symbol
Point point = new Point();
^
symbol: class Point
location: class SetPoint
2 errors
我在名為xyz的文件夾中有這兩個文件(Point.java和SetPoint.java)。 我不知道我在做什么錯。 如果我在IntelliJ中執行相同操作,它將正常工作。
package xyz;
public class Point {
int coorX;
int coorY;
}
。
package xyz;
public class SetPoint {
public static void main(String args[]){
Point point = new Point();
point.coorX = 10;
point.coorY = 20;
System.out.println("Coordinate of point: ("+point.coorX+", "+point.coorY+")");
}
}
同時編譯兩個java文件,
javac *.java
要么
javac SetPoint.java Point.java
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.