Which of the following is an invalid variable name in Java?
- $myVar
- 123var
- _myVariable
- myVar1
In Java, variable names must start with a letter, underscore (_), or dollar sign ($) and may be followed by letters, digits, underscores, or dollar signs. Option 2 (123var) is invalid because it starts with a digit, which is not allowed.
Loading...
Related Quiz
- A ________ is a result-bearing computation that can be canceled and can compute the result asynchronously provided by ExecutorService.
- Consider a scenario where you are tasked with designing a distributed application where objects need to be serialized and transmitted over the network. How would you optimize the serialization process to ensure minimal network usage and maximize performance?
- How do you specify a timeout while trying to connect to a remote socket?
- How can CSS be applied to style JavaFX components?
- How can transactions be managed in JDBC to ensure data integrity?