Hi,
I am new to java.
I have developed a single file
class cname
{
import java.io.*;
{
public static void main (Strings args[])
{
// some code
}
}
when i compile above programme, i found follwoing error
import java.io - illegal of start type
^
I think it may be due to improper classpath setting.
any help will be sincerely appreciated.
Hardik Shah
Java's syntax is a bit different; from to top bottom, you have to do this:
1) an (optional) package statement (you dont' need one for now);
2) all the classes you'd need to import;
3) your class or interface definition(s).
So your file should look like this:
-
import java.io.*;
-
-
class cname {
-
-
public static void main (Strings args[]) {
-
// some code
-
}
-
}
-
When you want to post some more, have a look at the little pane to the right
of the edit window: it explains how to make your code look like code.
kind regards,
Jos