当前位置:网站首页>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
边栏推荐
- 【图像增强】基于Step和Polynomial 滤波实现图像增强附matlab代码
- SwiftUI * SwiftUI 4.0 全新的导航系统
- Chapter 2数据分析
- Ingress的概念和原理
- 深度学习:优化器
- Second data CEO CAI data warming invited to jointly organize the acceleration data elements online salon
- SQL注入(2)
- 365 days challenge LeetCode1000 topic - Day 051 special binary sequence partition
- MVVM项目开发(商品管理系统二)
- Chapter3 numpy创建数组
猜你喜欢
随机推荐
23 Lectures on Disassembly of Multi-merchant Mall System Functions-Platform Distribution Level
多线程 (进阶+初阶)
Doris从理论详解到千万级数据量场景使用
Kubernetes:(十四)安全机制(一定要做好安全措施哦)
Image.new() 及 img.paste() 的用法记录
Redis expiration strategy and elimination strategy
最优化方法——0.618法matlab实现
数学基础(三)PCA原理与推导
jsx定义与规则
ros入门(安装)
别了,IE浏览器
Zabbix 5.0 监控教程(五)
Redis的过期策略和淘汰策略
CI/CD:持续集成/持续部署(难舍难分)
Chapter3 numpy创建数组
那些关于DOM的常见Hook封装(一)
01| 数据类型
The condition variable condition_variable implements thread synchronization
Day021 Book management system (objects and arrays)
powershell execution strategy