Compiling with java version4.0
<p>When I compile this code by compiler compliance level 6.0 in eclipse then it compile fine but when I change compiler level 4.0 then this code shows error that Incompatible Conditional operand types String and Integer. What is the problem and changes this code need to get the same result</p>

<pre><code>Calendar cal = Calendar.getInstance();
String timeStr = (calendar.get(Calendar.HOUR_OF_DAY) &lt; 10 ?    
    "0" + Integer.valueOf(calendar.get(Calendar.HOUR_OF_DAY)) :       
    Integer.valueOf(calendar.get(Calendar.HOUR_OF_DAY))) + ":" + 
        (calendar.get(Calendar.MINUTE) &lt; 10 ? 
        "0" + Integer.valueOf(calendar.get(Calendar.MINUTE)) : 
        Integer.valueOf(calendar.get(Calendar.MINUTE)));
</code></pre>
