datatype byte in java not allowing to add any literal
<p>i am trying some java code like this </p>

<pre><code>class Test {
public static void main (String [] args){
    byte b = 10;
    b = b + 10;
}
</code></pre>

<p>}</p>

<p>after saving when i tried to compile it , it is giving me an error </p>

<pre><code>D:\java\Test.java:4: possible loss of precision
</code></pre>

<p>found   : int
required: byte
        b = b + 10;
                      ^
1 error</p>

<p>but there is no if try something like this </p>

<pre><code>b++;
b+=10;
</code></pre>

<p>it is perfectly alright
what is reason for this ?</p>
