Which of the following is a legal Java identifier?

Which of the following is a legal Java identifier?

a) 1ForAll
b) oneForAll
c) one/4/all
d) 1_4_all
e) 1forall


Answer:  b.

Explanation:  Java identifiers cannot start with a number (so the answers in a, d and e are illegal) and cannot include the “/” character, so the answer in c is illegal.


Java

Learn More Multiple Choice Question :