Java basics _ day1
Learning content:
1. Java Development History
2. Differences and functions between jdk and jre.
3. Download and install jdk and jre
4. Configure the environment, path and classpath
5. helloworld Program
6. Conversion between hexadecimal values
7. Comments, flags, constants
8. Common variable types
Summary:
Java is developed by sun, where jdk is for developers and jre is a tool for running java programs. The reason why java programs are cross-platform is that virtual machines, among which jre includes virtual machines, jdk also contains jre. The latest jdk version is 8.0, and path is used to build the environment on the windows operating system. The path includes the bin directory, the bin directory contains the tools required by java. The java source code is in the java format and changed to the class format after javac compilation, that is, the bytecode format, classpath is the environment to be set up to run the class file, but it does not seem to need to be set up now.
Helloworld program:
Public class Hello {
Public static void mian (String args []) {
System. out. println ("hello world! ");
}
}
Class Definition class Hello, public static void mian is the main method, and braces are the definition interval of the program.
Java comments include single-line comments and multi-line comments. Multi-line comments cannot contain multi-line comments.
A variable is a space opened up in the memory to store data. The types of production check variables include integer, floating point, complex, and Boolean.
Int
Byte
Short
Long
Float
Double
Char
Boolean