|
Authored by: celtic_hackr on Tuesday, May 15 2012 @ 02:47 AM EDT |
"Java for C/C++ programmers", Michael C Dacounta, 1996, Wiley Computer
Publishing, pp 30-31.
"Source 2.3 both lists and demonstrates the rules associated with
identifiers.
Source 2.3
class Identifiers {
public static vod main(String args[])
{
// 1) C rule. Names can be letters and digits. MUST
// Start with a letter.
int legal_name;
// int 1_illegal; //ILLEGAL
// 2) C rule. underscores count as a letter
int _123_name;
//2a) Java addition to rule 2: dollar sign counts as a letter
int $123_name;
..."
The example continues on, but clearly 17 is not a possible symbolic name in
Java. Nor in Dalvik.
Also, while looking at this, I've hit upon a wonderful find. This book indicates
a number of the C++ APIs that Java copied. From <ctype.h>
"isDigit(c), isSpace(c), toLowerCase(c), and others"; from
<math.h> "The Java Math class serves the same purpose and almost all
of the functions are identical"; etc.
[ Reply to This | Parent | # ]
|
|
|
|
|