Is it possible to dynamically generate Unicode characters in Java?
<p>Basically, I would like to use Unicode symbols in my <code>System.out.println</code> lines, but these Unicode characters would need to be dynamically generated.</p>

<p>For example, take symbols <code>U+2074</code>, <code>U+2075</code> and <code>U+2076</code>, which return, respectively, <code>x^4</code>, <code>x^5</code> and <code>x^6</code>. To print them in Java I would use <code>\u2074</code>, <code>\u2075</code> and <code>\u2076</code>, but what if I want to generate them based on another value (i.e. <code>\u207x</code> where <code>x</code> is a variable)?</p>

<p>If I were using PHP, i would use <a href="http://php.net/manual/en/language.variables.variable.php" rel="nofollow">variable variables</a> for this which would be extremely handy.</p>

<p>I even went as far as thinking about using a hack like saving <code>u207</code> as a String, making my calculations on the value of <code>x</code> and appending this value to the string, but then there are issues introducing the <code>\</code> symbol inside a string:</p>

<pre><code>String unicodeBase = "u207";
// I do something to get a value for x
String unicodeChar = "u207" + x;
System.out.println("\unicodeChar");
</code></pre>

<p>If i do this, I get an <code>illegal unicode escape</code> error, which is expected. But then, if I escape the <code>\</code> symbol, then the output is a string that is not processed:</p>

<pre><code>System.out.println("\\unicodeChar");
</code></pre>

<p>This returns the string <code>unicodeChar</code>.</p>

<p>So, is it possible to dynamically generate Unicode characters in Java?</p>