Adrian Stent

Greenhorn
+ Follow
since Nov 19, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Adrian Stent

Thanks a lot, that makes sense it being a compile time constant within the range of the variable. The code proves it as well.

Cheers.
Why doesnt 'g' require a cast back down to byte after arithmetic is performed? The variable 'h' requires an explicit cast as the variables are promoted to int for the arithmetic.


Hope someone can explain this to me..
Cheers for that, I think I'm almost there, but confused when a dot is displayed instead of a number.
e.g char b = \u0031;
System.out.println(b); // This should print out 1 instead of the dot.
17 years ago
I thought a unicode value had to be in single qoutes when assigned to a char. For some reason, the following seems to compile and run ok, but only in the range of \00030 to \u00039 .

char d = \u0032; /* Compiles ok */
System.out.print(d);

char d = \u0040; /* Syntax error on token "Invalid Character", invalid VariableInitializer comes up */

Hope someone can explain this to me why single qoutes are not needed in the first example.
17 years ago