Today, I officially started learning java. The first example of learning a language is helloworld! Why use this example as an entry-level instance? It seems simple, but it contains a lot. Is it true that the essence of language is in it? Let's take a look. Now I know that to implement it, at least we have to do the following:
1. When installing JDK (jdk-7-windows-i586.exe is installed), you should learn to download the software online and install it on the PC correctly. You 'd better set the installation path, for example, C: \ Java.
2. For ease of operationCode, We need to set the environment variable path, right-click: My computer-> properties-> advanced-> environment variable-> system variable... double-click path (add one if no one exists), and add c: \ Java \ bin to the end. Separate the path from the preceding address with a semicolon. Set the environment variable classpath as described above. After the settings, restart the running window.
3. You must create a Java file with the suffix of Java, properly encode it, and save, compile, and use Java helloworld.
4. Correct encoding: both of the following are correct.
Public class helloworld {public static void main (string AGRs []) {system. Out. println ("helloworld! ") ;}} Public class helloworld {public static void main (string [] AGRs) {system. Out. println (" helloworld! ");}}
5. The helloworld name after the class must be the same as the saved file name, including the case.
6. The encoding is strictly case sensitive. helloworld and helloworld are completely different.
7. Pay attention to the format and correct indentation when writing code.
8. Write the file suffix during compilation, for example, javac helloworld. Java, and javac helloworld compilation will cause errors.