i am quite new to java
i used to code in c++ but now we have to program in java which has not been taught.
i browsed net but casn't get enough information
this is my first code which i managed to get from net
i am using GNU java compiler i.e, gcj in ubuntu
can anyone tell how to get the program completed.
this is what compiler shows
nchy@ubuntu:~/Desktop$ gcj hi.java
hi.java:1: error: The public type HelloWorld must be defined in its own file
public class HelloWorld {
^^^^^^^^^^
1 problem (1 error)
nchy@ubuntu:~/Desktop$ gcj hi.java
hi.java:2: error: The public type HelloWorld must be defined in its own file
public class HelloWorld {
^^^^^^^^^^
1 problem (1 error)
import java.io.*;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}