In VB.NET, we can surround a variable name with brackets and use keywords as variable names, like this:
Dim [new] As String = ""
C# equivalent:
string @new = "";
I was wondering is there a Java equivalent to doing this?
We cannot use a keyword as a variable name, function name or any other identifier. They are used to define the syntax and structure of the Python language. In Python, keywords are case sensitive.
Java 10 introduced a new way to declare variables using the var keyword.
No. You can add an underscores or somesuch nonsense, but basically keywords are off limits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With