• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

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: 9697
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.
 
Sheriff
Posts: 6959
1317
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: 9697
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: 27371
88
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.
 
We can fix it! We just need some baling wire, some WD-40, a bit of duct tape and this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic