Which of the following is the correct way to declare an integer variable in Java?
- float a;
- int a = 5;
- int[] a;
- integer a = 5;
In Java, the int keyword is used to declare an integer variable. The syntax is: int variableName = value;. The other options are not the correct ways to declare a single integer variable.
Loading...
Related Quiz
- The method ________ of ServerSocket class is used to listen for incoming client requests.
- Which of the following Java classes is used for URL processing and handling?
- What is the purpose of a parameterized constructor in Java?
- The ________ class in Java creates an immutable sequence of characters.
- In JDBC, the ________ provides methods to move to the first record, last record, next record, and previous record in a ResultSet.