当前位置:网站首页>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 trueShort-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
边栏推荐
- Wechat official account and synchronization assistant
- 1-Redis架构设计到使用场景-四种部署运行模式(上)
- Fundamentals of machine learning: feature selection with lasso
- Regular expression of shell script value
- OS interrupt mechanism and interrupt handler
- Mobile asynchronous sending SMS verification code solution -efficiency+redis
- Function: store the strings entered in the main function in reverse order. For example, if you input the string "ABCDEFG", you should output "gfedcba".
- Introduction to thread pool
- The culprit of unrestrained consumption -- Summary
- Network layer - routing
猜你喜欢

Some other configurations on Huawei's spanning tree

A-Frame虚拟现实开发入门

Gauss elimination method and template code

Avoid playing with super high conversion rate in material minefields

String hash, find the string hash value after deleting any character, double hash

The FISCO bcos console calls the contract and reports an error does not exist

Long article review: entropy, free energy, symmetry and dynamics in the brain

Self study software testing. To what extent can you go out and find a job?

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
随机推荐
In the process of seeking human intelligent AI, meta bet on self supervised learning
I don't care about you. OKR or KPI, PPT is easy for you
Pytest unit test framework: simple and easy to use parameterization and multiple operation modes
0 basic learning C language - nixie tube dynamic scanning display
Characteristics of ginger
Day05 表格
be based on. NETCORE development blog project starblog - (14) realize theme switching function
Mongodb learning notes: command line tools
Flutter local database sqflite
What is the future of software testing industry? Listen to the test veterans' answers
PMP 考试常见工具与技术点总结
Function: store the strings entered in the main function in reverse order. For example, if you input the string "ABCDEFG", you should output "gfedcba".
swagger中响应参数为Boolean或是integer如何设置响应描述信息
Windos10 reinstallation system tutorial
Severity code description the project file line prohibits the display of status error c4996 fopen ('fscanf ', StrCmp): this function or variable may be unsafe The most comprehensive solution
AI helps make new breakthroughs in art design plagiarism retrieval! Professor Liu Fang's team paper was employed by ACM mm, a multimedia top-level conference
1-Redis架构设计到使用场景-四种部署运行模式(上)
Struct in linked list
C library function int fprintf (file *stream, const char *format,...) Send formatted output to stream
The force deduction method summarizes the single elements in the 540 ordered array