当前位置: 技术问答>java相关
关于自定义包的问题,求救~~~~~~~~~~~~~~~
来源: 互联网 发布时间:2015-04-02
本文导语: //C:JBuilder4jdk1.3Abc.java package Test; public class Abc{ int x; public void show(){ System.out.println(x); } } //C:JBuilder4jdk1.3TestPackage import test.Abc; class PackageTest{ public static void main(String[] args){ Abc obj = new Abc(); obj.show(); }...
//C:JBuilder4jdk1.3Abc.java
package Test;
public class Abc{
int x;
public void show(){
System.out.println(x);
}
}
//C:JBuilder4jdk1.3TestPackage
import test.Abc;
class PackageTest{
public static void main(String[] args){
Abc obj = new Abc();
obj.show();
}
}
错误是classpath,为什么????
package Test;
public class Abc{
int x;
public void show(){
System.out.println(x);
}
}
//C:JBuilder4jdk1.3TestPackage
import test.Abc;
class PackageTest{
public static void main(String[] args){
Abc obj = new Abc();
obj.show();
}
}
错误是classpath,为什么????
|
//C:JBuilder4jdk1.3Abc.java
package Test; //既然是Test,为何不把文件放在...jdk1.3testAbc.java
public class Abc{
int x;
public void show(){
System.out.println(x);
}
}
//C:JBuilder4jdk1.3TestPackage
import test.Abc;
class PackageTest{ //是TestPackage还是PackageTest,要相同呀!
public static void main(String[] args){
Abc obj = new Abc();
obj.show();
}
}
祝你好运!
package Test; //既然是Test,为何不把文件放在...jdk1.3testAbc.java
public class Abc{
int x;
public void show(){
System.out.println(x);
}
}
//C:JBuilder4jdk1.3TestPackage
import test.Abc;
class PackageTest{ //是TestPackage还是PackageTest,要相同呀!
public static void main(String[] args){
Abc obj = new Abc();
obj.show();
}
}
祝你好运!