• 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
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Please explain why e# is not a legal identifier

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Please explain me why e# is not a legal identifier.

Thanks in advance
 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Identifier names cannot have any symbols except _ (underscore) or $ (dollar sign)...
 
indra negi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But in K&B book(Page no. 5) its written that "After the first character, identifiers can contain any combination of letters, currency characters, connecting characters or numbers".

If that is so then the identifiers can have any currency characters such as euro,pound etc. Please correct me if I am wrong.
 
Marshal
Posts: 7254
1395
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

indra negi wrote:If that is so then the identifiers can have any currency characters such as euro,pound etc. Please correct me if I am wrong.



You can use the dollars symbol only, e$ is a correct identifier.
 
indra negi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Devaka. Got it.

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry for reopen this thread, I´m studing for Exam 310-065.

"the identifiers can have any currency characters such as euro,pound"



I have tryed:



and compiles.

I have seen the list of connecting caracters http://www.fileformat.info/info/unicode/category/index.htm In essece the _ .

Can you give me a link to the valid currency characters?

Thanks for your attention,

Alex
 
Alejandro Rodriguez
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

list of connecting caracters:

http://www.fileformat.info/info/unicode/category/Pc/list.htm

Characters in the 'Symbol, Currency' Category

http://www.fileformat.info/info/unicode/category/Sc/list.htm


Sorry for answer again, but i can find "edit" button

Thanks for your attention.
 
Ankit Garg
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Alejandro Rodriguez wrote:Sorry for answer again, but i can find "edit" button .



The edit button looks like this . It is on the upper right corner of your post...
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Devaka Cooray wrote:

indra negi wrote:If that is so then the identifiers can have any currency characters such as euro,pound etc. Please correct me if I am wrong.



You can use the dollars symbol only, e$ is a correct identifier.





Hi, you can have this ... and compile

private int Çd;
private int ÇǼ_s;
private int Δd;


not only dollars symbol.

My question is...
Why this compile.... and what symbols not compile.
thanks





 
Marshal
Posts: 28293
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

indra negi wrote:But in K&B book(Page no. 5) its written that "After the first character, identifiers can contain any combination of letters, currency characters, connecting characters or numbers".



And all of the examples you posted satisfy that requirement. Don't fall into the trap of thinking that "letters" only means the letters used in your language.
 
My pie came with a little toothpic holding up this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic