Chaturaka Gunatilaka wrote:When I executed the code,I got the output as Sub.myMethod 0. But I was expecting Sub.myMethod 200.What went wrong?Why am I wrong?
Won't tell you that, you need to ShowSomeEffort (←click); but I will ask you this:
What happens when new Sub() gets executed? EXACTLY. If you're not sure, look it up (you may find some useful stuff here) and write it down. Then apply it to your problem and see what you come up with.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
a fool thinks himself to be wise, but a wise man knows himself to be a fool - shakespeare. foolish tiny ad: