Happy.J
October 13th, 2001, 07:10 AM
I've already learnt Java. It's new to me.
I've created a folder called "JavaProg" in c: and a folder called "classOne" in "JavaProg". The program Test.java is stored in folder "classOne".
"JavaProg" used to hold the java programs for compiling.
The code as follows:
package JavaProg.classOne ;
import java.io.*;
public class Test {
public static void main(String[] args) {
int i = 5;
while (i <= 8) {
System.out.println("i = " + i );
i++;
}
} //End of main
}//End of Test
I compiled the program as follows
"C:\JavaProg>javac Test.java"
But it said it can't read the file. Why ?? i've inclued the package statement but it can't work!!!
The main purpose is that I would like to run a java program which is stored in another folder.
I don't understand the use of package statemnet.
Can any of you teach me?
Thank you for your help!
I've created a folder called "JavaProg" in c: and a folder called "classOne" in "JavaProg". The program Test.java is stored in folder "classOne".
"JavaProg" used to hold the java programs for compiling.
The code as follows:
package JavaProg.classOne ;
import java.io.*;
public class Test {
public static void main(String[] args) {
int i = 5;
while (i <= 8) {
System.out.println("i = " + i );
i++;
}
} //End of main
}//End of Test
I compiled the program as follows
"C:\JavaProg>javac Test.java"
But it said it can't read the file. Why ?? i've inclued the package statement but it can't work!!!
The main purpose is that I would like to run a java program which is stored in another folder.
I don't understand the use of package statemnet.
Can any of you teach me?
Thank you for your help!