Thing is when call sup.a, f() method in the sub class will work . I think you know variable hiding when took a super class reference and created a sub class object. Since sub class 'b' is hidden by the super class variable super class cannot see wthat the value is in the sub class.Only it know it'sinteger type. So it give the default value of integer. Just put an integer value(such as 'return 5;') to returning value for the sub class and surely it will print that given value.
[ July 19, 2007: Message edited by: geethal rodrigo ]