| Author |
Effects of Static Variables when
|
Paul Okeke
Ranch Hand
Joined: May 16, 2009
Posts: 58
|
|
|
I reaaly want to the implication of calling static members of a class with an instance of such class. For example, Calendar now=Calendar.getInstance(); now.setTimeInMilis(someLongValue); now.MONTH; it gave some incorrect value but i want to know why?
|
OCJP 1.6
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56529
|
|
What do you think now.MONTH should have returned?
If you think it was the month of the loaded date, then you are not correct. now.MONTH is simply a key to be passed to into method such as get() and set();
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Paul Okeke
Ranch Hand
Joined: May 16, 2009
Posts: 58
|
|
|
At the begging I thought it will return the loaded Date but I found that I was long. Thanks for your concern.
|
 |
 |
|
|
subject: Effects of Static Variables when
|
|
|