Java 关键字作为变量 [英] Java Keywords as a variable
本文介绍了Java 关键字作为变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 VB.NET 中,我们可以用括号将变量名括起来,并使用关键字作为变量名,如下所示:
In VB.NET, we can surround a variable name with brackets and use keywords as variable names, like this:
Dim [new] As String = ""
C# 等效:
string @new = "";
我想知道是否有 Java 相当于这样做?
I was wondering is there a Java equivalent to doing this?
推荐答案
没有.您可以添加下划线或一些类似的废话,但基本上关键字是禁止的.
No. You can add an underscores or somesuch nonsense, but basically keywords are off limits.
这篇关于Java 关键字作为变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文