当前位置:网站首页>Logical operator, displacement operator
Logical operator, displacement operator
2022-07-04 01:10:00 【@Where did you get Xuan ^o^】
Logical operators
&&( And ) ||( or ) !( Take the opposite )
boolean a=true; boolean b=false; Systen.out.pritnln("a&&b:"+(a&&b));// Logic and computation : Both variables are true , The result is true false Systen.out.println("a||b:"+(a||b));// Logic or operation : Two variables and one is true , The result is true true Systen.out.println("!(a&&b):"+!(a&&b));// The result is true , It becomes false , If true, it becomes false true
Short-circuit operation ( If the first condition is not satisfied, the next condition will not be executed )
int c=5; boolean d=(c<4)&&(c++<4); Systen.out.pritnln(c);//5 Systen.out.pritnln(d);//false
Displacement operators
& 、|、^、~、>>、<<、
/* A =0011 1100 B =0000 1101 A&B=0000 1100 A|B=0011 1101 A^B=0011 0001 ~B =1111 0010 2*8=16 2*2*2*2 Efficient !!! << *2 >> /2 0000 0000 0 0000 0001 1 0000 0010 2 0000 0100 4 0000 1000 8 0001 0000 16 */ Systen.out.pritnln(2<<3);//16
边栏推荐
猜你喜欢
功能:编写函数fun求s=1^k+2^k +3^k + ......+N^k的值, (1的K次方到N的K次方的累加和)。
Function: write function fun to find s=1^k+2^k +3^k ++ The value of n^k, (the cumulative sum of the K power of 1 to the K power of n).
Hash table, string hash (special KMP)
MySQL - use of aggregate functions and group by groups
[dynamic programming] leetcode 53: maximum subarray sum
[error record] configure NDK header file path in Visual Studio (three header file paths of NDK | ASM header file path selection related to CPU architecture)
In the process of seeking human intelligent AI, meta bet on self supervised learning
0 basic learning C language - nixie tube dynamic scanning display
swagger中响应参数为Boolean或是integer如何设置响应描述信息
Introduction to A-frame virtual reality development
随机推荐
我管你什么okr还是kpi,PPT轻松交给你
All in one 1412: binary classification
查询效率提升10倍!3种优化方案,帮你解决MySQL深分页问题
Employees' turnover intention is under the control of the company. After the dispute, the monitoring system developer quietly removed the relevant services
OS interrupt mechanism and interrupt handler
leetcode 121 Best Time to Buy and Sell Stock 买卖股票的最佳时机(简单)
0 basic learning C language - nixie tube dynamic scanning display
Future source code view -juc series
Sequence list and linked list
Weekly open source project recommendation plan
MySQL -- Introduction and use of single line functions
swagger中响应参数为Boolean或是integer如何设置响应描述信息
Who moved my code!
CLP information - how does the digital transformation of credit business change from star to finger?
Function: find the approximate value of the limit of the ratio of the former term to the latter term of Fibonacci sequence. For example, when the error is 0.0001, the function value is 0.618056.
What is the future of software testing industry? Listen to the test veterans' answers
Cesiumjs 2022^ source code interpretation [8] - resource encapsulation and multithreading
Cloud dial test helps Weidong cloud education to comprehensively improve the global user experience
2-Redis架构设计到使用场景-四种部署运行模式(下)
基于.NetCore开发博客项目 StarBlog - (14) 实现主题切换功能