Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Java Identifiers ! Question Maji exam

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is a Java keyword. keyworks are reserved identifiers that predefined inthe language.
 
reply
    Bookmark Topic Watch Topic
  • New Topic