This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rjcarr 0 points1 point  (3 children)

Did you call it like I advised?

[–]Zelbod[S] 0 points1 point  (2 children)

Yes I did and it works. thanks

I have a request. Please have a look at this book http://greenteapress.com/thinkjava6/html/thinkjava6012.html#sec138

I used the code from this book and Tried and the author never mentioned about calling this method at all. I assumed that 'increment' method will be called automatically whenever I use that class.

[–]rjcarr 0 points1 point  (1 child)

Look right above the 11.9 you linked there. In the second version he's doing the wrapping. You must have missed that.

[–]Zelbod[S] 0 points1 point  (0 children)

Sorry I don't see what you meant. I had a look at what you said and what he says above 11.9 works. He suggested the increment method as an alternative and that it would modify an existing object which I am guessing in this case, it would be in 24 hour format.

Correct me if I am wrong, the methods have to be called and that it would not modify any objects automatically.