1)Question
class Super
{ int index = 5;
public void printVal()
{ System.out.println( "Super" );
}
}
class Sub extends Super
{ int index = 2;
public void printVal()
{ System.out.println( "Sub" );
}
}
public class Runner
{ public static void main(
String argv[] )
{ Super sup = new Sub();
System.out.print( sup.index + "," );
sup.printVal();
}
}
The result is (5,Sub).Why is not (2,Sub)?Who know reason.
Thank you.
2)Question
The finally statment execution finish .The rest of the method countinue to run.(True or False)?