The second lesson of learning java basics

Second lesson:

I.
1. Study character set, keywords, identifiers
2.JAVA data types, including integer type, float type, character type, a Boolean type, and complex data types (classes, interfaces, arrays)
⑴ character set:
①English letters A~Z, a~z and numbers 0~9 in the ASCII character set; ②Chinese
characters, Japanese, Korean, and Greek;
③Common special symbols, such as "&", "¥", "@" Wait.
⑵Identifier:
①Identifier is used for command program object, composed of text characters (including letters, Chinese, etc.), numbers, underscore (_), dollar sign ($), and cannot start with a number;
② Java keywords cannot be used as Identifier;
③There is no limit on the length of the identifier;
④Identifier is strictly case sensitive, such as My and my are different identifiers;
⑶Keywords
① are all lowercase
② Change color
constant: the value will not change during the entire program operation .
⑷Java data types are
divided into simple integer types and composite data types; ①Integer
types: byte, short, int, long; such as 10, -10.
②Floating point types: float, double; such as 1.23.
③Character types: char; such as . 'A'
④ Boolean: Boolean; as to true, to false.
⑤ categories: as class
. ⑥ interfaces: interface
⑦ array of
two,
open the disc D into the computer, a new java folder, open java01 new folder.
Insert picture description here
Insert picture description here
Open the java01 folder to create a new text document, check the file extension, and then rename java02.java, right-click to edit and write the source code.
Insert picture description here
Insert picture description here
Enter cmd, and enter dir in java to view the directory.
Insert picture description here
Insert picture description here
Then enter javac java02.java to compile, the class file appears, enter java java02 to run.
Open the notepad, click Save File As, select the ASCII code, and then run the text.
Insert picture description here
Insert picture description here
Insert picture description here
Remarks: Big Data 2003 Zhang Yao Student ID: 2020080603020

Guess you like

Origin blog.csdn.net/weixin_55680204/article/details/114408349