This week's book giveaway is in the Kotlin forum.We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Liutauras Vilda
• Devaka Cooray
• Jeanne Boyarsky
• Bear Bibeault
Sheriffs:
• Junilu Lacar
• Paul Clapham
• Knute Snortum
Saloon Keepers:
• Ron McLeod
• Tim Moores
• Stephan van Hulst
• salvin francis
• Carey Brown
Bartenders:
• Tim Holloway
• Frits Walraven
• Ganesh Patekar

# range of char

Ranch Hand
Posts: 45
What is the range of char??? What is the numerical range of char??? Is numerical range and 'range' the same thing/

Ranch Hand
Posts: 112
'u0000' to 'uffff'

antraarora
Ranch Hand
Posts: 45
What is numerical range then? Chars are always unicode 16bit? Does that mean numerical range is 16?

Ranch Hand
Posts: 98
The range of char is 0 to 65535.

Ranch Hand
Posts: 18944
it is also sometimes expressed:
0 to 2^16

Surya B
Ranch Hand
Posts: 98
It is 0 to 2^16-1,not 0 to 2^16.

Anonymous
Ranch Hand
Posts: 18944
Sorry for the mistake, I write faster than I think some times.

Anonymous
Ranch Hand
Posts: 18944
Why the following are not compilied:
char c='\u000a';char c='\u000A';
but char c='\u000b' char c='\u000f' working.
thanks

Anonymous
Ranch Hand
Posts: 18944
Here is what The Java Language Specification (Chapter3) said:
"Because Unicode escapes are processed very early, it is not correct to write '\u000a' for a character literal whose value is linefeed (LF); the Unicode escape \u000a is transformed into an actual linefeed in translation step 1 (�3.3) and the linefeed becomes a LineTerminator in step 2 (�3.4), and so the character literal is not valid in step 3. Instead, one should use the escape sequence '\n' (�3.10.6). Similarly, it is not correct to write '\u000d' for a character literal whose value is carriage return (CR). Instead, use '\r'. "

 All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad: RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database