当前位置:网站首页>01| Data Type
01| Data Type
2022-08-09 03:11:00 【farming garden】
1 Learning Insights
1.1 Why learn java
java can do desktop applications, such as banking software, shopping mall settlement software; develop Internet-oriented applications, such as online digital malls, Alibaba and eBay, etc.
1.2 Confused
There is so much java content, can't you learn it?Are there so many scenes?Can't hold on?How to break?
1.3 Principles
At the beginning of learning, do not entangle with the scene, do not entangle with the principle; language comes from life, programming also comes from life, the first thing we have to do is not to prepare various software, but to integrate ourselves into a program firstin the minds of members.
What can be explained in life, the code must be written; the code that cannot be explained, the code must not be written.
Don't be hesitant, don't be confused, if you have any questions, please ask the classmates in the surrounding clubs.Persevere to the end, and you will surely reap the rewards.
1.4 Language Sense
Not at the beginning, through a lot of practice and accumulation process
1.5 How to Learn
Copy first, understand the requirements, and then without looking at the source code, you can write those small demos by yourself. In the final analysis, it is just four words: write more, think more.
2 Java Environment Construction
2.1 Download and install JDK
Notes:
- Select version 1.7/1.8 (software development, the more stable the better, not the newer the better)
- JDK installation select the corresponding system type 32/64 operating system
- There cannot be Chinese characters and special characters between the paths
2.2 Configuring environment variables
2.2.1 Configuring JDK
Take win7 as an example:
JAVA_HOME:localJDK installation path
CLASSPATH: %JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar;
PATH: %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
2.2.2 java program in three steps

2.2.3 java virtual machine and cross-platform principle

3 Java Coding Specifications
3.1 escape characters
\t : move the cursor to the first cell of the next line
\n: move the cursor to the next horizontal tab position
\r: return the cursor position to the beginning of the line
3.2 Coding Conventions
1. Write one sentence in one line
2. Pay attention to indentation
3. Pay attention to capitalization
4. All symbols are half-width in English
4 data types
4.1 8 basic data types
| Data Type | Size | value range |
|---|---|---|
| byte | 1 byte 8 bits | -128 ~ +127 |
| int | 4 bytes 32 bits | -2147483648 (-231) ~ +2147483647 (231-1 ) |
| short | 2 bytes 16 bits | -32768 (-215) ~ + 32767(+215-1 ) |
| long | 8 bytes 64 bits | -263 ~+ 263-1 |
| float | 4 bytes 32 bits | 1.4E-45~ 3.4E+38, -1.4E-45~-3.4E+38 |
| double | 8 bytes 64 bits | 4.9E-324~ 1.7E+308, -4.9E-324 ~ -1.7E+308 |
Where: In java, the default type of integer is int type, and the default type of floating point type is double type
4.2 Variable Naming Rules
1. Word (letter), underline (underscore), beauty (dollar sign), person (RMB sign), number (number), camel (camel case)
2. Meaningful
3. Cannot use keyword: publicclass
4. The first letter of the variable name is lowercase
5. In the same code block: the variable name cannot be declared repeatedly
6. Boolean type
7. Character type
8. Constant: inAdd final
before the statement 9. Naming rules: all letters are capitalized, and words are separated by underscores
5 Type Conversion
5.1 Type Conversion Rules
1. The short one can be directly put into the long one
2. The long one cannot be directly put in the short one, it needs to be converted
3. The low precision can be directly converted to high precision
4, high precision cannot be directly converted to low precision, it needs to be forced to be converted
边栏推荐
- Day021 Book management system (objects and arrays)
- i18n 国际化
- 数据库工具DataGrip V2022.2正式发布——支持导入多个 CSV 文件的选项
- phpStdudy的下载和DVWA的搭建
- Embedded system driver advanced [3] - __ID matching and device tree matching under platform bus driver development
- Redis expiration strategy and elimination strategy
- 【元胞自动机】基于元胞自动机模拟社会力因素下的灾害人员疏散应急仿真附matlab代码
- 2022-08-08 The fifth group Gu Xiangquan study notes day31-collection-junit unit test
- 马斯克被因狗狗币被索赔2580亿美元 操纵价格牟利?狗狗币已下跌92%
- 如何实现canal数据同步
猜你喜欢
随机推荐
JSON beautification plugin for Chrome
Postman interface test [official website] latest version installation and use tutorial
JavsScript系列-Promise的错误捕获
Kubernetes:(十四)安全机制(一定要做好安全措施哦)
一本通1258——数字金字塔(动态规划)
20220526动态规划:不同路径
Day021 Book management system (objects and arrays)
C专家编程 第10章 再论指针 10.2 指针数组就是Iliffle向量
Cyanine5tetrazine(CAS号:1427705-31-4)结构式原理
flat() :递归地将数组展平到指定的深度
SwiftUI * SwiftUI 4.0 全新的导航系统
下秒数据CEO蔡致暖受邀参加联合数据举办《数据要素加速跑》线上沙龙
关于eBPF与可观测性,你想知道的都在这里
365 days challenge LeetCode1000 topic - Day 051 special binary sequence partition
Kubernetes:(十五)PV与PVC的《恩怨情仇》
MVVM项目开发(商品管理系统二)
Building PO layered architecture of automated testing framework from 0
Shell脚本:函数
权限系统就该这么设计(万能通用),稳的一批!
Exchange VLAN experiment









