当前位置:网站首页>Variable, "+" sign, data type
Variable, "+" sign, data type
2022-07-02 12:50:00 【Onycho】
3.1 Concept : Variable is equivalent to the representation of a data storage space in memory , You can think of variables as the house number of a room , We can find the house by the house number between , You can access variables through their names ( value )
3.1 Basic steps of variable usage
1) Declare variables
int a;
2) assignment
a = 60; // I should say so : hold 60 Assign to a
Use System.out.println(a);
public class VarDetail{
// Write a main Method
public static void main(String[] args) {
// Variables must first declare , After use , There is order
int a = 50;//int
System.out.println(a);//50
// The data value of this area can constantly change within the same type
//a = "jack";//x
a = 88;//√
System.out.println(a);//88
// Variables cannot have the same name in the same scope
//int a = 77;//×
}
}
class Dog {
public static void main(String[] args) {
int a = 666;//√
}
}
3.3 In the program + Use of numbers
3.4 data type
3.5 The type of integer
public class IntDetail{
// Write a main Method
public static void main(String[] args){
//java The integer constant of ( Specific value ) The default is int type , Statement long Type constant must be added later ‘l’ or ‘l’
int n1 = 1;// Bytes
//int n2 = 1L;// incorrect , reason L = long byte , Occupy 8 Memory , and int Account for only a 4 Memory
long n3 = 1L;// Yes
}
}
3.5.1 Case presentation :
byte n1 = 10;( Memory allocated 1 Bytes )
short n2 = 10;( Memory allocated 2 Bytes )
int n3 = 10;( Memory allocated 4 Bytes )
long n4 = 10; ( Memory allocated 8 Bytes )
3.6 Floating point usage details
3.6.1 explain
1) A brief description of the storage form of floating point numbers in the machine , Floating point numbers = Sign bit + Exponential position + mantissa
2) The mantissa may be lost , Loss of accuracy ( Decimals are approximations ).
边栏推荐
- spfa AcWing 851. spfa求最短路
- js2day(又是i++和++i,if语句,三元运算符,switch、while语句,for循环语句)
- Apply lnk306gn-tl converter, non isolated power supply
- 软件测试面试题-2022年大厂面试题合集
- 8 examples of using date commands
- 3 a VTT terminal regulator ncp51200mntxg data
- Visual studio efficient and practical extension tools and plug-ins
- Efficiency comparison between ArrayList and LinkedList
- 8A Synchronous Step-Down regulator tps568230rjer_ Specification information
- Oracle from entry to mastery (4th Edition)
猜你喜欢
移动式布局(流式布局)
Js2day (also i++ and ++i, if statements, ternary operators, switch, while statements, for loop statements)
上手报告|今天聊聊腾讯目前在用的微服务架构
Interview with meituan, a 34 year old programmer, was rejected: only those under the age of 30 who work hard and earn little overtime
线性DP AcWing 899. 编辑距离
Dijkstra AcWing 850. Dijkstra finding the shortest circuit II
js4day(DOM开始:获取DOM元素内容,修改元素样式,修改表单元素属性,setInterval定时器,轮播图案例)
Direct control PTZ PTZ PTZ PTZ camera debugging (c)
The programmer and the female nurse went on a blind date and spent 360. He packed leftovers and was stunned when he received wechat at night
JS8day(滚动事件(scroll家族),offset家族,client家族,轮播图案例(待做))
随机推荐
染色法判定二分图 AcWing 860. 染色法判定二分图
Redis avalanche, penetration, breakdown
Deep copy event bus
PR 2021 quick start tutorial, learn about the and functions of the timeline panel
js4day(DOM开始:获取DOM元素内容,修改元素样式,修改表单元素属性,setInterval定时器,轮播图案例)
Get started REPORT | today, talk about the microservice architecture currently used by Tencent
Dijkstra AcWing 850. Dijkstra finding the shortest circuit II
Js7day (event object, event flow, event capture and bubble, prevent event flow, event delegation, student information table cases)
Mobile layout (flow layout)
线性DP AcWing 895. 最长上升子序列
LTC3307AHV 符合EMI标准,降压转换器 QCA7005-AL33 PHY
哈希表 AcWing 841. 字符串哈希
面渣逆袭:MySQL六十六问,两万字+五十图详解!有点六
Package management tools
Oracle from entry to mastery (4th Edition)
Std:: vector batch import fast de duplication method
接口测试面试题目,你都会了吗?
JDBC prevent SQL injection problems and solutions [preparedstatement]
8A 同步降压稳压器 TPS568230RJER_规格信息
spfa AcWing 852. SPFA judgement negative ring