Java Lesson 1: environment, variables, data types, java Lesson 1
I. java programming considerations
1. java case sensitive
2. Each statement ends with a semicolon
3. Pay attention to indentation for lower-level code
4. Braces must appear in pairs.
5. punctuation marks should be in English halfwidth (difference between halfwidth and fullwidth)
Ii. eclipse
1. eclipse is self-compiled and timely compiled
2. java ee contains java se
Iii. Variables
1. +: concatenates multiple texts into one sentence.
2. Using a variable is equivalent to using the data in the variable.
3. numbers cannot be used for naming the first letter, which is case sensitive and cannot be reserved. Chinese characters are not recommended.
4. variables are not declared and cannot be used.
5. The variable name definition should be "known and known", and the camper naming method should be salary, javaScore/studentName, etc.
6. uninitialized variables cannot be used. We recommend that you initialize the variable declaration.
Iv. Basic Types
1. overflow: the integer is changed to a negative number, and vice versa (large-type conversion to small-type conversion is easy to overflow)
2. the integer direct variable is int type int a = 32;
3. The direct number of floating point numbers is double Type double B = 0.11;
4. Unicode is to compile each character symbol in the main language of the earth into a number.
5. The essence of the char type is a 16-bit unsigned integer, which is the Unicode encoding of the character. 0-65535
6. char must be enclosed in single quotes. 0-9 48-57 A-Z 65-90 a-z 97-122
7. Results are automatically converted to larger types during operations involving multiple basic types.