And tell us why it doesn't work; you have made a common beginner's error
Javad Rashidi wrote:try this . . .
Javad Rashidi wrote:try this
Result will print 0 again due to Overflow
Wouter Oet wrote:And check out line 13. Are you sure that is the m want to assign the value to?
Nonsense. That is quite mistaken.
Tarun wadhwa wrote: . . . and the reason why it returns the value of "m" 0(Zero) when you print it because you have made it static and static variables are loaded when the first time class name has been called and it can't see Instance Variable or non static methods. . . .