video from:http://www.marschen.com/
1. What is a variable
2. Declaration of variables
3. What types are variables divided into?
What is a variable?
1. The computer is an extremely accurate machine;
2. To store information in a computer, you must indicate the location of the information store and the storage space required;
3. In Java into language, use the LIFE statement to accomplish the above tasks;
Declaring methods for variables
int age;
Variable type variable name means statement end
This statement allows the computer to allocate enough space to store an integer whose name is called Age. int is a Java-defined data type that is dedicated to storing integers of a certain size;
What types of variables are used?
Basic data type:
Integer type: Int (byte, short, int, long)
Floating-point type (float,double)
Character type: (char)
Boolean type: (Boolean)
Reference data type:
Classes (Class)
Interface (interface)
Array
Naming conventions for variables
1. Variable naming syntax specification
1. Should be preceded by a letter underline or dollar sign;
2. The following letter underlines the dollar symbol or number;
3.java variable name has no length limit;
4.java variable name is case sensitive
2. Camel naming law:
1. Variable names should use meaningful English words;
2. Variable name if there is only one word, all the letters are lowercase;
3. If a variable name consists of multiple English words, the first letter is capitalized from the second word;