Topic: 关于package的。 |
Print this page |
1.关于package的。 | Copy to clipboard |
Posted by: ccmv Posted on: 2004-12-02 17:59 我门在d:下这样写 package j.myclass; import javax.swing.*; public class Myclass extends Object { public void printout () { JOptionPane.showMessageDialog(null,"chao","hello world!",JOptionPane.INFORMATION_MESSAGE); } } javac -d . Myclass.java 编译通过.在d下有j文件夹. 在写 import j.myclass.*; public class ExtendExample { public static void main(String arg[]) { myclass a = new myclass(); a.printout(); } } javac ExtendExample.java 错误: file does not contain class myclass Please remove or make sure it appears in the correct subdirectory of the classpa th. myclass a = new myclass(); ^ 1 error |
2.Re:关于package的。 [Re: ccmv] | Copy to clipboard |
Posted by: ccmv Posted on: 2004-12-02 19:04 但是删掉Myclass.java 后就可以了, |
3.Re:关于package的。 [Re: ccmv] | Copy to clipboard |
Posted by: auauau Posted on: 2004-12-02 23:15 哈,我觉得应该改成 Myclass a = new Myclass(); |
4.Re:关于package的。 [Re: ccmv] | Copy to clipboard |
Posted by: ninky Posted on: 2004-12-03 15:48 可以啊 !我只是改了 把 package j.myclass; 改成 package x; 把第二个里面的import j.myclass.*; 改成import x.myclass; 就可以了!! |
5.Re:关于package的。 [Re: ccmv] | Copy to clipboard |
Posted by: ccmv Posted on: 2004-12-03 17:38 能解释一下为什么会这样吗? |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |