title: Java type mismatch cannot convert from int to byte?
body: <p>I'm wondering why the <code>//1</code> statements are accepted by the compiler and the <code>//2</code> statements are not </p>
  
  <pre><code>    //1
      int k = 99999999;
      byte l = (byte)k;
  
      //2
      byte b = 1;
      int i = 10;
      byte z = (byte)i+b; //compiler rejected 
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/42890653/type-mismatch-cannot-convert-from-int-to-byte-using-ternary-operator">Type mismatch: cannot convert from int to byte using ternary operator</a> gave me somewhat of an idea but I don't understand why the compiler can resolve the variable <code>l</code> in <code>//1</code> as acceptable and not <code>i</code> in <code>//2</code></p>