这个波浪号是什么意思? [英] What does this tilde mean?
本文介绍了这个波浪号是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在阅读一些JMockit示例并找到此代码:
I was reading through some JMockit examples and found this code:
final List<OrderItem> actualItems = new ArrayList<~>();
通用标识符中的波浪号是什么意思?我知道它是一元按位NOT运算符,但我没有在这里看到一个操作数。
What does the tilde in the generic identifier mean? I know it's the unary bitwise NOT operator, but I don't see an operand here.
另外,我尝试编译它并得到一个错误。我只是遗漏了一些东西吗?
Also, I tried compiling it and got an error. Am I just missing something?
推荐答案
这只是与宣言中相同的简写。
It is just a shorthand for "same as in declaration".
一些IDE,例如IntelliJ也使用它。
Some IDEs, e.g. IntelliJ use this too.
磁盘上的文件没有这种表示法,这只是IDE GUI中的压缩。
The files on disk do not have this notation, which is only a compaction in the IDE GUI.
这篇关于这个波浪号是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文