Java from cainiao to proficient (1)

Source: Internet
Author: User

The following is what I have read books, watch videos, listen to the teacher, and summarize over the past few days. I hope it will be useful to you .....

The full name of JVM is: Java Virtual Machine
Java Runtime Environment Java development and operation

The row environment contains JVM
The full name of JDK is: Java Development Kit

Including JVM and JRE

% Java_home % dynamically set JDK Environment Variables

On-demand JDK configuration in DOS mode: set command: view or set environment variable

Value
Set Path = environment variable value
Set path view, the value will change, but it is temporary
Add another value to the temporary environment variable: Set Path = new path; %

PATH %
The dos enabled by start is the value of the parent dos.

Class: a keyword in Java. It is used to define classes.

It must be defined in the class.
Keywords: words with special meanings granted by Java.
Single line comment:
// Annotation: 1. annotation, explanation, meaning of the Program 2. Used to debug the program
Multi-line comment:
/*
**/

Java special comment: Document comment: javadoc puts forward the comments of this program

To form a webpage. This webpage is the instruction for writing programs. This

It is intended for developers.
/**
Author: XX version: xx
*/

Basic components of the Java language:
1. Keywords
Keyword definition and features
(1) Definition: words with special meanings granted by the Java language
(2) features: all the letters in the keyword are in lower case.
Keywords used to define the data type:
Class interface byte short int long

Float double char Boolean void
Keywords used to define data type values:
True False null
Keywords used to define process control:
If else switch case default while

Do for break continue return
Keyword used to define the access permission modifier:
Private protected public abstract

Keyword of the class, function, and variable modifier:
Final Static synchronized
Keywords used to define the relationship between classes:
Extends implements
Defines the creation and reference of an instance and determines the instance's keywords:
New this super instanceof
Keyword used for exception handling:
Try catch finally throw throws
Keyword used for the package:
Package Import
Other modifier keywords:
Native strictfp transient volatile

Assert

2. identifier
Is some names customized in the program.
It consists of 26 English letters (uppercase and lowercase) and digits (0-9): _ $.
Define valid specifier rules:
1. Numbers cannot start
2. You cannot use keywords.
Strictly case sensitive in Java
Note: When naming, make it as meaningful as possible to improve readability.
Naming rules in Java:
Package name: when multiple words are made up, all letters are in lower case. (Xxxyyyzzz)
Class Name and Interface Name: when multiple words are made up, the first letter of all words is capitalized.

(Xxxyyyzzz)
Variable name and function name: when multiple words are made up, the first letter of the first word is lowercase and the second

Starts with uppercase letters. (Xxxyyyzzz)
Constant name: All letters are capitalized. When multiple words are used, each word is connected by an underscore.

(Xxx_yyy_zzz)

3. Notes
Single line comment:
// Annotation: 1. annotation, explanation, meaning of the Program 2. Used to debug the program
Multi-line comment:
/*
**/

Java special comment: Document comment: javadoc puts forward the comments of this program

To form a webpage. This webpage is the instruction for writing programs. This

It is intended for developers.
/**
Author: XX version: xx
*/

4. constants and variables
A constant indicates a value that cannot be changed.
Classification of constants in Java:
1. integer constant. All integers
2. Decimal constant. All decimal places
3. boolean constants. It is special and has only two values. True False

.
4. character constants. Enclose a number, letter, or symbol in single quotation marks ('')

Id.
5. string constants. Mark one or more characters with double quotation marks.
6. null constant. Only one value is: NULL
For integers: Java has three forms.
1. Decimal: 0-9, full 10 into 1.
2. octal sequence: 0-7, full 8 into 1, starting with 0.
3. hexadecimal: 0-9, A-F, full 16 into 1, starting with 0x.

Variable concept:
1. a storage area in the memory.
2. The region has its own name (variable name) and type (data type)
3. Data in the region can be continuously changed within the same type range.
Why do we need to define variables:
1. It is used to store constants of the same type and can be reused.
Note the following when using variables:
1. Scope of the variable (valid)
2. initialization value
Define the variable format:
1. Data type variable name = initialization value
2. Note: The format is fixed. Remember the format to be retained.
Understanding: variables are like unknowns in mathematics.

Variable: stores uncertain data. That is, it needs to be opened in the memory.

A space.

Opening up the memory space is accomplished by specifying the data type, variable name, and data.

The Java language is a strongly typed language and defines a specific number for each type of data.

Data Type. Different memory sizes are allocated in the memory.

Data types include: Basic Data Types and Reference Data Types
Basic data types include: numeric, Char, and Boolean

)

The referenced data types include: Class, interface, and array.

([])

The numeric type also includes: Integer type (byte, short, Int, long) and floating point class

Type (float, double)

Integer default: int decimal point default: double

5. Operators
Value assignment operator
Symbol:
=, + =,-=, * =,/=, % =
Example:
Int A, B, C; a = B = c = 3;
Int A = 3; A + = 5; equivalent to a = a + 5;

Interview Questions:
Short S = 4;
S = S + 5; // This compilation fails, because s will be upgraded to the int type, after the computation

Whether the value belongs to the int type. Cannot be assigned to the short type. Two operations: add first,

Assign another value

S + = 5; // This compilation is successful, because the + = Operator automatically completes the assignment to S.

Forced conversion operation. In one operation, he only performs one value assignment operation.

In comparison, this type can be automatically converted

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.