ورود

View Full Version : سوال: دلیل اخطار



ravand
سه شنبه 06 تیر 1391, 10:30 صبح
سلام این کدهای منه :
package test;
class Main {
public static void main(String args[]) {
Test ob = new Test(15, 20);
System.out.print("ob.a and ob.b before call: ");
System.out.println(ob.a + " " + ob.b);
ob.meth(ob);
System.out.print("ob.a and ob.b after call: ");
System.out.println(ob.a + " " + ob.b);
}
}
و اخطار زیر را می دهد:

init:
deps-jar:
Compiling 1 source file to F:\java\bin\test\build\classes
F:\java\bin\test\src\test\Main.java:4: cannot find symbol
symbol : class Test
location: class test.Main
Test ob = new Test(15, 20);
F:\java\bin\test\src\test\Main.java:4: cannot find symbol
symbol : class Test
location: class test.Main
Test ob = new Test(15, 20);
2 errors
BUILD FAILED (total time: 0 seconds)

spiderman200700
سه شنبه 06 تیر 1391, 13:30 عصر
سلام.
احتمالا کلاس Test توی یه package دیگس.
اگه اینطوره باید Test رو import کنی داخل کلاس Main