Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Java in General
Calendar.add not working..
Jerry Crothers
Ranch Hand
Posts: 34
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
This is really starting to tick me off. I just want to get a Calnedar and add to it 6 months:
Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH,6);
I am debugging in eclipse. After the 2nd line there is no change in the calendar object
Christophe Verré
Sheriff
Posts: 14691
16
I like...
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
What makes you thing that it doesn't change ?
Try a System.out.println on it, before and after calling "add".
[My Blog]
All roads lead to JavaRanch
Jerry Crothers
Ranch Hand
Posts: 34
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Ok I was loooking in 'variables' in Eclipse and nothing was changing. But then I added a watch expression and the value of it did change. Quite annoying...
Christophe Verré
Sheriff
Posts: 14691
16
I like...
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Don't know how you're doing this
"Variables" are also updated when stepping through the program
"VariableS" window:
GregorianCalendar
fields=int[17]
->Values are changing while debugging.
Anyway, glad you've fixed this.
[My Blog]
All roads lead to JavaRanch
What do you have in that there bucket? It wouldn't be a tiny ad by any chance ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
increment date by 6 days
Word Games
Festivals and economy
Gui button with calendar popup
checking for date
More...