Hi all, Which of the following are valid Java identifiers? a) _3_ b) $abcp c) this d) instance e) thisabigvariable f) 2i# My answer is a,b,d,e. Given Answer is a,b,c,d,e Can 'this' be a valid identifier?. May be very basic Question,but by looking at the answer I am somewhat upset. When I try putting 'this' in an program I got an compilation error. To confirm my answer I am posting this. Help me. Thanks in advance. Nirmala
rumit
Greenhorn
Joined: Jul 12, 2000
Posts: 5
posted
0
this is not a valid identifier i think the book in u read is wrong.
Uthirapathi Prabu
Greenhorn
Joined: Jul 17, 2000
Posts: 19
posted
0
hai nirmala, "this" is not a valid identifier. It refers to the current executing object. "this" is the reserved word for java prabu ------------------
Nirmala
Ranch Hand
Joined: Jun 28, 2000
Posts: 93
posted
0
HI rumit, Thank you all for your help. This is from Maji exam which is specified in the Subject. Thanks Nirmala
maha anna
Ranch Hand
Joined: Jan 31, 2000
Posts: 1467
posted
0
Yes Nirmala. The word 'this' can not be a valid identifier. Let us move this thread to our 'Mock Exam Errata' forum. regds maha anna
Joseph Zhou
Ranch Hand
Joined: Aug 01, 2000
Posts: 129
posted
0
this is a Java keyword. keyworks are reserved identifiers that predefined inthe language.