File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes decrease int value whenever a minute passes Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "decrease int value whenever a minute passes" Watch "decrease int value whenever a minute passes" New topic
Author

decrease int value whenever a minute passes

Sanjul Jain
Greenhorn

Joined: Oct 21, 2004
Posts: 14
Hello!

I am a newbie to java and shall greatly appreciate your help.

I have an array of capacity 10 with values say {0,3,1,0,0,0,0,0,0,0}

the values in array, which are not zero, need to be decremented to 0. e.g. 3 needs to be decremented to 0. the criteria for decreasing value of 3 is that 3 should decrement by 1, after 1 minute of system time, until 3 is 0, and the value of 3 should be replaced by 0, in the array.


Thanks in advance,
Sanjul
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1815
What code do you have to do this?

Are the numbers supposed to be decreased one at a time, or all at once?
That is , does the array {1, 2, 3} go to {0, 2, 3} or to {0, 1, 2}?

Possibly the simplest way it to sleep the thread. Otherwise, you may need to use some sort of timer.

Post what code you have, and we'll see if we can help.


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: decrease int value whenever a minute passes
 
Similar Threads
Notrajon Mock Question 18
Array Declaration
binary search
multidimentional array
generics doubt