Timeline for Why does Java compiler decide whether you can call a method based on the "reference" type and not on actual "object" type?
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 31, 2013 at 14:30 | comment | added | Sahil Chhabra | @DaveHillier: I think you also need to read the question again. I already mentioned the point given by DeveloperArnab in my question that it would give compile time error as Java compiler check for the method in Class A and he doesn't finds the method methB() in it, so it gives error. My question was why does java compiler looks for the method in Class A and not in Class B? Correct Answer to this has been given by Lesstat, David and Aniket Thakur | |
Jul 31, 2013 at 12:27 | comment | added | Dave Hillier | @mav3n no, I think you don't understand his answer, no surprise given the question... | |
Jul 31, 2013 at 8:48 | comment | added | Sahil Chhabra | Please read the question carefully before answering. I think you didn't get what I asked. | |
Jul 31, 2013 at 8:43 | history | answered | Arnab | CC BY-SA 3.0 |