当前位置:网站首页>One minute to familiarize yourself with the meaning of all fluent question marks
One minute to familiarize yourself with the meaning of all fluent question marks
2022-06-25 16:08:00 【. calin.】
The ?? Double question mark operator “ If empty ”. Take the following expression as an example .
String a = b ?? ‘hello’;
It means a be equal to b, But if b by null, be a be equal to ’hello’.
2.
Another related operator is ??=. for example :
b ??= ‘hello’;
This means that if b by null, Set it to hello. otherwise , Do not change .
3.
String? name;
Adding a question mark allows the static check to pass , Represents a nullable type ,String? Is a nullable type String,
Type followed by operator ? Indicates that the current variable can be null.
4.
Use (.) To access an instance variable or method of an object :
Use ?. Instead of . You can avoid that because the expression on the left is null And the resulting problems
边栏推荐
- VectorDraw Developer Framework 10.1001 Crack
- Go language - lock operation
- Multithreading, parallelism, concurrency, thread safety
- Check whether the port number is occupied
- AutoK3s v0.5.0 发布 延续简约和友好
- 分享自己平时使用的socket多客户端通信的代码技术点和软件使用
- Why does golang's modification of slice data affect the data of other slices?
- Client development (electron) system level API usage
- [problem solving] dialogfragment can not be attached to a container view
- Alvaria宣布客户体验行业资深人士Jeff Cotten担任新首席执行官
猜你喜欢
MySQL installation tutorial

Startup and shutdown of appium service

How to reload the win10 app store?

《睡眠公式》:怎么治睡不好?
Consumer and producer cases of inter thread synchronization (condition variable)

Educational administration system development (php+mysql)
Time wheel and implementation analysis of time wheel in go zero

合宙Air32F103CBT6开发板上手报告

Dino: Detr with improved detecting anchor boxes for end to end object detection

TFIDF and BM25
随机推荐
Prototype mode
The style of the mall can also change a lot. DIY can learn about it!
GO语言-什么是临界资源安全问题?
深度学习 pytorch cifar10数据集训练「建议收藏」
Continuously improve the overall performance of adaoracle Oracle Oracle
Native JS dynamically add elements
In the wechat environment, H5 jumps to the specified page of the applet
Once the code was encrypted by the company's computer, the compilation failed
Most commonly used SQL statements
What can one line of code do?
About the use of Aidl, complex data transmission
GO语言-锁操作
NFT元宇宙发展能做什么?
Go development team technical leader Russ Cox sends a document to share go's version control history
Differences between = = and = = = in JS (detailed explanation)
Converting cifar10 datasets
Tensorflow loading cifar10 dataset
f_ Read function [easy to understand]
leetcode-8. String to integer (ATOI)
原生js动态添加元素