JAVASE -- Environment Variable

Source: Internet
Author: User

1. Environment Variables
1) variables: for programming languages
A. local variables (c, java)
All variables declared in method (java), process (c), or function (c) are collectively referred to as local variables.
There is a small difference between a process and a function. A process has no return value. A function has a return value method. Whether there is a return value, it is a method.
B. global variables (c, java (java's global variables are actually attributes)
The variable declared externally by the method is a global variable.
{
Int a; (local variable)
}
2) Memory Distribution
Stack zone (variable): automatically maintained by the system, and the region where the local variable is located
Heap area (object): the area where the java object is located. manually release the object in C ++. in JAVA, the garbage collector releases the space.
Code area: Load Code from the hard disk to the memory, and run the code from the memory.
Data zone: constant and other data
3) Local Code
Operating system API (method)
4) environment variables:
Environment variables are used by the program to provide relevant information to the program. Global Variables
The environment variable is not only valid under the shell defined by it, but also valid in the shell's self-shell.
A. Key-value pairs
LANG = UTF .....
B. Define an environment variable
WINDOWS:
Set JAPEN = dog
Note: windows variable names are case-insensitive.
% JAPEN % indicates that the value of Japan is used.
In LINUX:
Export JAPEN = dog
C. view environment variables
In WINDWOS:
Set environment variable name
In LINUX:
Echo $ Japan
Note: $ is the variable value.
Variable name is case sensitive
D. Learn to set environment variables in windows
Omitted
E. Some system environment variables
PATH environment variable: Used for the command interpreter (shell.
Set PATH = C: \ Program Files (x86) \ Tencent \ QQ \ Bin \; % PATH %
5) shell: The command interpreter can only execute executable files.
6) Deploy the JAVA environment
JAVA_HOME is not required when third-party software is not involved.
Java-version (1.6.10)
7) The first JAVA program HelloWorld. javas
8) Compile and run the program
A. javac HelloWorld. java (the compiled. class will be placed in the current directory)
B. java HelloWorld
C. Set CLASSPATH
D. Compile the source code to get the. class file and put it in the specified bin directory.
Javac-d ../bin Operator. java
9) KEYWORDS
A. Operator
+,-, *,/, %, ++, --, ^ ,!,~, &, &, |, |
B. Flow controllers
If .. else
While
Do... while
For
Switch
C. Data Type
Eight basic types:
Numeric type:
Byte 1
Short 2
Int 4
Long 8
Float 4
Double 8
Char 2
Boolean:
Boolean 1
Reference Type:
Types except the eight basic types
For example, class, interface, anotation, enum, and Other types are defined.

Author: "angeo2010"
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.