how do I import package (to package above present work directory) in Java?
here is the directory structure:
[![enter image description here]]
public class Coba
public static void main(String args)
Orang org = new Orang();
// I can't import kabar.*; since it's above present work directory
public class Orang
public int a;
this.a = 1;
public void haha()
i want to:
Tes t = new Tes();
public class Tes
public int b;
this.b = 2;
How do I access variable b in class Tes by importing class kabar.Tes from class Orang?
If i write
in class Orang. It doesn't work because class Orang is above present work directory.
Thank you very much.
BTW, I don't use Netbeans or Eclipse. I want to know the basic how it works, so I just use simple text editor.
以上就是Java Import Package (to package above present work directory)的详细内容，更多请关注web前端其它相关文章！