Variable Types
- Which of these can not be used for a variable name in Java?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Keywords are specially reserved words which can not be used for naming a user defined variable, example : class, int, for etc.
- Literal can be of which of these data types?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Literal can be integer, float and boolean.
- Literals in java must be appended by which of these?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Data type long literals are appended by an upper or lowercase L.
- Which of these can be returned by the operator & ?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
We can use binary ampersand operator on integers/chars (and it returns an integer) or on booleans (and it returns a boolean).
- Which of these is long data type literal?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Data type long literals are appended by an upper or lowercase L. 0x99fffL is hexadecimal long literal.