This week's book giveaway is in the Other Open Source APIs forum. We're giving away four copies of Storm Applied and have Sean Allen, Peter Pathirana & Matthew Jankowski on-line! See this thread for details.
I agree with Paul. Everyone should write or ask question without any typing mistake. It can create confusion among new users. As far as question is concerned, person who has posted this question should edit it & write it correctly to avoid further confusion.
If answer B is believed to be correct, then line 15 should be read as c.my();
Since my() is a static method, it cannot be overridden. static methods are shared by all instances of class. on line 15, any of the following code will give same output that is a.
Line 16 gives output as d.
Even though we have reference of Car, at run time Java Virtual Machine checks whether the instance to which reference is referring to has the method with same name or not.(Comment line 12, & run the code, output will be ab). If it has, then method m2 gets overridden.(which is why you get output as d).
So, the final output is ad.
I hope the answer has cleared your doubts.
All the best.