Computer Applications
Answer
1value
Reason — In Java, an identifier (e.g., variable, method, or class name) must follow these rules:
- It cannot start with a digit (e.g.,
1value
is invalid because it starts with1
). - It can start with a letter, an underscore (
_
), or a dollar sign. - It can contain letters, digits, underscores (
_
), and dollar signs after the first character.
As 1value
starts with a digit, hence it is an invalid identifier.
Related Questions
Write the memory capacity (storage size) of short and float data type in bytes.
Name the keyword which:
- indicates that a method has no return type.
- makes the variable as a class variable
What are the resulting data type of the following explicit conversions?
int i; float f; double d; short s; char c; byte b;
(a) (float) i/b + d;
(b) (int)f*d + c/s;
(c) (char)i + f - b*d;
(d) (double) (f/i)*c + s;
(e) (char) d + b/i - f*s;
Which of the following is an escape sequence character in Java?
/n
\t
/t
//n