• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Java Identifiers ! Question Maji exam  RSS feed

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is not a valid identifier
i think the book in u read is wrong.
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI rumit,
Thank you all for your help.
This is from Maji exam which is specified in the Subject.
Thanks
Nirmala
 
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is a Java keyword. keyworks are reserved identifiers that predefined inthe language.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!