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.
I wonder how a hamster feels, out in the wild where there's no wheels -- Ogden Nash (or should've been).
Articles by Winston can be found here