View Single Post
  #4   Spotlight this post!  
Unread 25-11-2011, 00:08
linuxboy linuxboy is offline
Registered User
AKA: Oliver Graff
FRC #3780
Team Role: Alumni
 
Join Date: Nov 2010
Rookie Year: 2009
Location: MI, USA
Posts: 217
linuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud of
Re: Just installed Java: example won't compile

Quote:
Originally Posted by de_ View Post
(appears to be) Resolved

Changed the name of the class from 1310Robot to T1310Robot (as well as file name and project name) and now it compiles. From this I can only conclude Java must not allow class names starting with numerics and the compiler does not have an error message that reflects that. The error message it put out was highly misleading. Ouch.
Yup, thats correct. And the error message is technically meaningful since 1310Robot isn't a valid identifier, its just not specific as to why.

The rules for java naming are:
Start with a letter, underscore, or dollar sign
After that, anything but spaces and special chars
Case sensitive
Can't use a keyword (like class or public)
(Paraphrased from http://mathbits.com/mathbits/java/Da...amingrules.htm)

Oliver
Reply With Quote