Installed an editor, notepad++, this editor used to write PHP, like to use, hehe, now write Java also first follow this editor.
Code:
Public class test{ publicstaticvoid main (string[] args) { System.out.print ( "hello!"); // output Java }}
According to the current understanding:
System.out.print (); This is the output statement.
System.out.println (); This is a newline output statement.
Each class name must be the same as the file name, or it will be an error.
Each file must be written above the main frame, that is, the above code, in addition to the output of the statement unexpectedly, the specific reason to write this, and then understand it later.
Java is strictly case-sensitive, so be sure to pay attention.
Java is developed by Sun, divided into three major systems, Java SE (Do desktop development), Java EE (do Web development), Java ME (do embedded development, such as mobile phones, small appliances, etc.)
After the code is written, save the file as Test.java (the Java suffix is. java), save to the E drive, and then turn on DOS
Input e: Enter, switch to the E-drive
Input Javac Test.java Enter, execute this DOS command, will compile the Java file, because Java is to be compiled into binary to execute, after compiling in the sibling directory will produce a same file name, different suffix, suffix. Class of the compiled file. Now that the Test.java file has been compiled, you can execute the
Enter Java Test carriage return, you can execute Java program, the above code will output hello!
Writing the first Java program