Is it possible to differentiate between character and integer stored in the same integer array?
<p>My code is</p>

<pre><code>int array[] = {'a',98};
for(int num:array) {
    System.out.println(num);
}
</code></pre>

<p>If I print this, I'll get o/p as <strong>97 98</strong>.</p>

<p>If I print <code>(char) num</code> then o/p will be <strong>a b</strong>.</p>

<p>Is it possible to print the array as <strong>a 98</strong>? My guess is as array will store integer values of the array elements, it is not possible. But any solution here?</p>