41.0k views
1 vote
Which of the following is not a legal identifier?

app_234
happyTimesAhead
321Go
cis22B

User Augustus
by
8.0k points

1 Answer

4 votes

Answer:

321Go

Step-by-step explanation:

The identifiers in C, C++, C#, Java and other programming languages are a combination of letters, numbers and the underscore symbol. The laters versions of C and C++ allows you to use almost all Unicode characters. In Java, you can use also the dollar sign.

From that you have to be careful to follow these rules:

-Don't use keywords.

-Don't include white spaces.

-Don't use operators.

-Don't repeat identifiers.

-Don't start your identifier with a number.

-Don't use two consecutive underscores.

So app_234, happyTimesAhead, and cis22B are follo wing these rules but 321Go starts with a number.

User Martin Seubert
by
8.9k points

No related questions found