It sud be like this brother,
public static void main(String args[] )
Though the compiler doesn't detect it, its a logic error.
You need to refer more books dude .....both the statements work absolutely fine in java .....
and personally i prefer
public static void main(String []args) .....
The only reason u cannot run a file is that u must have not added
\bin to the system path ... for example if u've installed java in
c:\jdk5 .. then u need to add this to the system path :
c:\jdk5\bin ... things should run fine after that ....
But i'd suggest u to download
JCreatorLE from here :
*www.jcreator.com/download.php?c=62c17291cf80a42763ec26fe8226cca7
U should be able to easily compile/run programs ....it has a very easy-to-use interface ....
Also if u write a code with a single class then declare the class as
public and name the code as the class name .......for now atleast ...
Code:
public class prg{
public static void main(String []args){
System.out.println("Hello!");
}
}
save this as
prg.java as i've declared the class
public