This project concludes the series of character studies by exploring a Cyrillic symbol. It demonstrates that Java's char type natively supports a wide range of global characters through the Unicode standard.
Task 63: Find and display the Unicode numeric code for the character 'Ж'.
Requirements:
- Declare a
charvariable and assign it the value'Ж'. - Perform an integer conversion to reveal the numeric code.
- Print the result in the exact format:
Symbol code 'Ж': ....
- Encoding Mastery: Utilizing Java's UTF-16 character representation to handle non-ASCII characters.
- Data Transformation: Seamlessly casting between character and integer types for data inspection.
- Unicode Range: While 'W' was in the basic Latin range (87), 'Ж' is located in the Cyrillic block, resulting in a significantly higher numeric value.
- Memory Consistency: Regardless of the symbol, Java allocates 2 bytes for any
charvariable.
Symbol code 'Ж': 1046
Project Structure:
src/com/yurii/pavlenko/
└── CyrillicRune.java # Main Entry Point & Logic
Code
package com.yurii.pavlenko;
public class CyrillicRune {
public static void main(String[] args) {
char cyrillicCharacter = 'Ж';
int revelationCode = (int) cyrillicCharacter;
System.out.println("Symbol code 'Ж': " + revelationCode);
}
}This project is licensed under the MIT License.
Copyright (c) 2026 Yurii Pavlenko
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files...
License: MIT