Menu
Topics Index
...
`

legal Identifiers


If you need explanation Read this topic

If you need Answer Take test on this topic

legal Identifiers
Which of the following can be used in a Java program as identifiers? Check all of the identifiers that are legal.
1. sum_of_data
2. AnnualSalary
3. _average
4. 42isThesolution
5. B4
6. ABC
7. for
8. println
9. "hello"
10. first-name

A. 1, 2 
B. 1, 2, 3
C. 1, 3, 5, 6 
D. 1, 2, 3, 5, 6, 8 
E. 1, 2, 3, 5, 6, 10
Topic: Java Variables

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

D is the correct answer as we cannot use keywords as identifiers and identifier cannot start with digit and cannot use - also

Posted by Ram Reddy Bitla    2013-09-02 03:31:29


D. since identifiers cannot use the names of reserved keywords(such as for,println,etc..) and cannot start with numbers, and illegal using - for joining the name of identifier.

Posted by Shabaaz Shaikz    2013-09-02 04:16:06


answer is A

Posted by Shiva Goud    2013-09-02 10:16:27


answer is D because identifier defines the names of classes, packages and interfaces.Identifiers does not start with number and in identifier we use only $and_symbols are used  and middle it may contains numbers and does not start with capital letters and in identifiers there is difference between captial letter and small letter example age is differ fromAGE

Posted by Raghava Bijinepalli    2013-09-02 12:44:34


Congratulations Ram Reddy Bitla. You are this dose winner. Please send us your mobile details in a private message and we will process the recharge asap.

Posted by Merit Campus    2013-09-03 04:05:20


thanks MC i got RC

Posted by Ram Reddy Bitla    2013-09-05 04:17:12


© meritcampus 2019

All Rights Reserved.

Open In App