由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Re: Put classes into different files
相关主题
问一简单的问题 关于importRe: transfer files over Internet
How to import a class?java EL 问题请教
[转载] 这个是什么错误呀?Jar question
get full class namemultiple classes in one file:revisted
新手问一个:如何找.jar文件里都有什么class?折腾了一天,实在是绝望了,请教请教
How to use classes in a jar file?Re: [转载] Re: .jar文件是怎么产生的?
有没有像汇编一样读.class file的工具?Re: 奇怪?? import找不到package
问个run java file 的问题Re: help: how does the class Model$5.class come?
相关话题的讨论汇总
话题: put话题: files话题: dir话题: file话题: import
进入Java版参与讨论
1 (共1页)
x***n
发帖数: 291
1
no need to import as long as ur files are under the same dir, and
you can just do it. if you want to use import, you need specify the
dir name where your file reside.
suppose you put file1.java in dir /java/file/file1.java
your file1.java should indicate the package name, like :
//file1.java code
package file;
public class file1 .....
and you put use.java in dir /java/use.java
//use.java code
import file.*;
public class use ...
Now you can use file1.java in use.java.
you can compile both files u
1 (共1页)
进入Java版参与讨论
相关主题
Re: help: how does the class Model$5.class come?新手问一个:如何找.jar文件里都有什么class?
Re: print problem, GUI guru please come inHow to use classes in a jar file?
Re: java class decompile有没有像汇编一样读.class file的工具?
Cryptoquivalence Classes问个run java file 的问题
问一简单的问题 关于importRe: transfer files over Internet
How to import a class?java EL 问题请教
[转载] 这个是什么错误呀?Jar question
get full class namemultiple classes in one file:revisted
相关话题的讨论汇总
话题: put话题: files话题: dir话题: file话题: import