There are a lot of tutorials on how to download installation environment variables for the configuration online.
The code for the first HelloWorld is attached below
/** This is my first Java program */Publicclass helloworld{ public Static void Main (string[] args) { System.out.println ("Hello world!") ); }}
Without an integrated development environment, you write the program to Notepad and change the suffix of the file to. Java this is the standard program for Java source programs. After we're done, we'll start compiling. Now ctrl+r into cmd switch to. java Location//CD (the directory where the files are located) and then enter the Javac file name. After the suffix is compiled, a Java-compiled file with a. Class end appears and then the Java file name is compiled to run Completed the
And then one of the problems is that the file name cannot contain special characters such as _
next to the first program to comment
The top is the comment, Java available comments A total of three kinds of a will be explained
The Top public (access modifier) is the one that tells the program that can access that is inaccessible (refer to C + +)
Class is a keyword this is a class name that is followed by a HelloWorld
Main is still behind the entrance to the program () is the parameter
The following SYS----is the only statement in the content method of the main method that calls the System.out class and then wants the console output HelloWorld
byte code interpretation and execution
C + + (compiled language) is compiled with the executable. exe and Java (interpreted language) compiled with a. Class bytecode file
Bytecode is a set of highly optimized instructions in the Java Runtime System (JVM).
JVM: We do not consider our program to run on that platform, because the virtual machine (JVM) of the different platforms understands the same bytecode, it implements the portability of the platform, and the security (through the JVM before execution, which masks a lot of things). So hackers no one uses Java to black things.
The first program in Java