title: error: incompatible types: boolean cannot be converted to List<String>
body: <p>I am getting the below error.
  Line 15: error: incompatible types: boolean cannot be converted to List
  integer.toString() returns a string instance and I am adding that to a list of Strings. 
  Why does it give boolean cannot be converted to error. Because return value is string and value I want to add is also a string.</p>
  
  <p>enter code here</p>
  
  <pre><code>class Solution {
    public List&lt;String&gt; findMissingRanges(int[] nums, int lower, int upper) 
    {
      List&lt;String&gt; res=new ArrayList&lt;String&gt;();
      if(nums.length==0
      {
          if(upper-lower==2)
          {
              //String a=Integer.toString(lower+1);
              //res.add(a);
              res.add(Integer.toString(123));
          }
          else if(upper-lower&gt;2)
          {
  
              return res.add(Integer.toString(lower)+"&gt;"+Integer.toString(upper));
           }   
      }
  
      int r=upper;
      boolean flag=false;
      for(int i=0;i&lt;nums.length;i++)
      {
  
          if(i==0 &amp;&amp; nums[i]-lower&gt;=2 &amp;&amp; res.size()==0)
          {
              upper=nums[i];
              flag=true;
          }
          else if(i!=nums.length-1)
          {
              upper=nums[i+1];
              lower=nums[i];
          }
          if(i==nums.length-1)
          {
              lower=nums[i];
              upper=r;
          }
          if(upper-lower==2)
          {
              //int temp=lower+1;
              Integer temp=new Integer(lower+1);
              res.add(temp.toString());
              if(i==0 &amp;&amp; flag==true)
              {
                  i--;
                  flag=false;
              }
          }
          else if(upper-lower&gt;2)
          {
              int a=lower+1;
              if(i==0 &amp;&amp; flag==true)
              {
                  i--;
                  a=lower;
                  flag=false;    
              }
              int b=(i==nums.length-1)?upper:upper-1;
              String subRes=a+"-&gt;"+b;
              res.add(subRes);
  
  
          }
  
      }
      return res;
  
    }
  }
  </code></pre>