Hi
I'm new to Java and I was dealing with the creation of packages.
Suppose I have the following two source files which I want to put in one package called mypackage.
The two source files are in the (Linux) directory: /home/user/workspace/mypackage.
package mypackage;
public class HelloWorld
{
public static void main(String[] args)
{
System.out.println("Hello, world!");
output.func();
}
}
package mypackage;
public class output
{
public static void func()
{
System.out.println("This is my package!");
}
}
To compile the Helloworld class in Linux terminal, I did the following command:
javac mypackage.HelloWorld.java
but unfortunately I get the "javac: file not found: mypackage.HelloWorld.java" error.
Can you please help me with a step by step way of compiling and executing these source files.
cheers