what is logic behind this java code
<p>I came across below java line and puzzled about its output. Can you please explain me logic behind this code</p>

<pre><code>System.out.println((int)(char)(byte) -1);
</code></pre>

<p>Output:</p>

<pre><code>65535
</code></pre>
