• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Legal/Illegal Identifiers

 
Ranch Hand
Posts: 88
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, i started reading SCJP 6 Certification book by Kathy & Bert. in Chapter 1, Under Legal Identifiers they are saying 'int e#' is an illegal identifier (page-5). But why? It started with a litter -right?

Thanks
 
Bartender
Posts: 4568
9
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And are you allowed '#' in Java identifiers?
 
Faisal Fuad
Ranch Hand
Posts: 88
IBM DB2 Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see So only $ and _ (connecting character) are allowed but no other special characters are allowed (anywhere in the identifier definition). Of course in legal cases always I have to be careful how the identifier is starting.

Thanks Brown
 
Greenhorn
Posts: 29
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just to be thorough, legal characters in identifiers are defined as "currency symbols" and "connecting characters". Most times, $ and _ are used as examples, but many other currency symbols and connecting characters are allowed. Just FYI...
 
There were millions of the little blood suckers. But thanks to this tiny ad, I wasn't bitten once.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic