当前位置:网站首页>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 ).
边栏推荐
- Why do programmers have the idea that code can run without moving? Is it poisonous? Or what?
- Hundreds of web page special effects can be used. Don't you come and have a look?
- 哈希表 AcWing 841. 字符串哈希
- Shutter encapsulated button
- Obtain file copyright information
- Browser storage scheme
- Linear DP acwing 895 Longest ascending subsequence
- 哈希表 AcWing 840. 模拟散列表
- 浏览器存储方案
- BOM DOM
猜你喜欢
JS7day(事件对象,事件流,事件捕获和冒泡,阻止事件流动,事件委托,学生信息表案例)
Counting class DP acwing 900 Integer partition
C operator
spfa AcWing 852. SPFA judgement negative ring
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
Deep copy event bus
Floyd AcWing 854. Floyd finds the shortest path
[ybtoj advanced training guide] similar string [string] [simulation]
Interval DP acwing 282 Stone merging
js3day(数组操作,js冒泡排序,函数,调试窗口,作用域及作用域链,匿名函数,对象,Math对象)
随机推荐
js3day(数组操作,js冒泡排序,函数,调试窗口,作用域及作用域链,匿名函数,对象,Math对象)
Deep copy event bus
Interesting interview questions
FBX import under ue4/ue5 runtime
3 A VTT端接 稳压器 NCP51200MNTXG资料
C#运算符
[ybtoj advanced training guidance] cross the river [BFS]
趣味 面试题
. Net wechat message template push
计数类DP AcWing 900. 整数划分
Js3day (array operation, JS bubble sort, function, debug window, scope and scope chain, anonymous function, object, Math object)
Linear DP acwing 898 Number triangle
Js4day (DOM start: get DOM element content, modify element style, modify form element attributes, setinterval timer, carousel Map Case)
正确遍历EntryList方法
2.7 binary tree, post order traversal - [FBI tree]
线性DP AcWing 897. 最长公共子序列
Direct control PTZ PTZ PTZ PTZ camera debugging (c)
Js5day (event monitoring, function assignment to variables, callback function, environment object this, select all, invert selection cases, tab column cases)
8A Synchronous Step-Down regulator tps568230rjer_ Specification information
. Net, C # basic knowledge