Originally posted by arun mahajan:
Thanks Ilja for the reply..No I am not facing any performance problems but perhaps just was more worried on it..Thanks anyway..
You should probably be more worried about maintainability and extensibility...
Time to reiterate the Three Rules Of Optimization:
1. Don't
2. (for experts only) Don't - yet
3. (if and only if you really need to optimize) Use a profiler to find the actual bottleneck - it isn't where you think it is.
One thing I was not able to understand that why Method 2 won't compile..perhaps it is not properly written i modeified it in following way and found working..Is that was the only reason or you want to point out something special..
In your original post, you forgot the method body in class A - that's all.

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus