A preliminary understanding of the Java environment and to build a data type

A preliminary understanding of the Java environment and to build a data type:

1, the installation jdk:

Into the oracle official website to download and install.

2, the environment variables:

JDK bin directory to find the point in the installation path into the copy path, find the path click Edit, then go click New, fill in the path, click OK in the environment variable.

Inclusive: jdk> jre> jvm

1、jdk

Java Developer's Kit java development kit produced products

2、jre

Java Runtime Environment java runtime environment to run the product

3, jvm java virtual machine

Virtual Machine the Java
1), cross-platform interpreter 2), a virtual computer 3), standards

3, write HelloWorld

1, the latest version

You may be used jshell (jdk8.0 above can be used directly in the window dos)

2, Classic

Compiled language (compiled after the first run) three steps
three steps:
1), the editing stage: write source code xxxx.java
2), the compile phase: javac Xxxx.java à Xxxx.class file
3), the operational phase: java Xxxx

Code:

/**
打印Helloworld
*/
public class HelloWorld{
   /*
  			 入口点
  */
  public static void main(String[] args){
     			 //程序体  展开。。。。。。
  }
 
}

4, simple dos command:

Absolute and relative paths
letter D: E: F: C:
cd absolute path (must be in the same letter) relative path switching path
cls clear screen exit to exit the
tab automatically filled
↑ ↓ command

5, source code and class relations:

N up to a type of work in a public source to a general class

6, the data type:

1, the basic data types:
Basic data types
2, reference data types:
reference data types (complex data): two boxes
"Chinese" String à System Customization
person Person à programmers to define their own

7, variable:

Three elements:
type
identifier | variable names
match | compatible with the values of
variable names: Naming positioned directly
naming rules (syntax definition does not comply with compilation errors):
Composition: Alphanumeric _ $ helloworld welcome1 hello_world hello $ world
can not start with a number: 1hello 1ab
not java is already used in the definition of the name (keywords and reserved words) lowercase
naming convention (non-compliance with industry standards kid actor): see name known Italian code of efficient
variable name | name of the method: a small hump named box scoreOfJava println ()
class name: big hump HelloWorld Weclome first letter of each word capitalized
constants: PI MAX_VALUE all uppercase letters
in line with the type of value
statement | define the variable
type variable name = initial value;
use of variables
exist: variable name = value;
take: variable name

8. Summary:

to sum up

Published 13 original articles · won praise 13 · views 499

Guess you like

Origin blog.csdn.net/Rabbit_white_/article/details/104061128