What we are sharing today is the data of variables and data types in Web front-end learning.
Data types actually refer to the classification of data.
The data types in the C # language have several common data types: 1, char (character type): Single character (Chinese characters, letters, numbers, punctuation marks), expressed in pairs of single quotation marks.
2, String (String type): Unlimited amount of text; double quotation marks in English
3, int (integer type): Used to represent an integer; direct writing
4, double (decimal type): The number used to represent the decimal point
Variable: A piece of space that stores data, and the data content of that memory area can change
When you use a variable in your code, you must first declare it and then assign the value. Declaration: Specify a memory space to hold data syntax: data type variable name;
Assignment: The memory space syntax for storing data into variables: variable name = data;
Use specification for variable naming: A, can only be composed of numbers, letters, underscores
B. Do not start with a number
C, the name cannot be the same as the keyword
D, variable names must not be the same in the same function variable
Soft requirements: A, to be able to look at the text to understand the meaning
B, first letter lowercase
C, in addition to the first word, the first letter of the other words capitalized
How to use variables: Merge declarations: Declaration of multiple variables of the same type, which can be done in a declaration statement
Declaring when initializing: initializing a variable while declaring it
Initialization: The process of assigning a value to a variable for the first time
Variable three elements: data type, variable name, variable value
Operation of the data
Numeric operations: Operational rules: Support operations: + 、-、 *,/,%, + + 、--
return type: Same as Operation type (note : int and int, return the result to int type; DOUBLR with double operation, return type double, double with int, return result to double)
String operations: Arithmetic rules: stitching (+)
return type: string
Basics of Web front-end Learning 2