1)
class Ex4{
1.public static void main(
String[] args){
2.String s = "-";
3.Integer x= 343;
4.long L343 = 343L;
5.if(x.equals(L343)) s+=".e1";
6.if(x.equals(343)) s+= ".e2";
7.Short s1 = (short)((new Short((short)343))/(new Short((short)49)));
8.if(s1==7)
9.s+="=s";
10.if(s1<new Integer(7+1)) s+="fly ";
11.System.out.println(s);
12.}
13.}
Wrf to Example4, chapter 6, its bit confusing to understand type conversions ..
1)how can we compare a Integer object with Long object resulted in line no.6
2)On line no 8, why do we need to convert to short, in place of that can we use �Short�.
3)On line 11, how does comparison happens? Specially its comparison of 2 different wrappers.
2) is-a relationship always rely on
polymorphism? Can anyone pls explain this statement
3) What does exactly happen when a code between try and finally (there isn�t any catch block) throws an Exception?