Results 1 to 5 of 5
- 06-08-2011, 11:22 PM #1
Member
- Join Date
- Jun 2011
- Posts
- 2
- Rep Power
- 0
i need to + one to gamelength during this proccess but it needs to be a statement
Java Code:class GCTask extends TimerTask { public void run() { gamelength + 1 ; // this needs to be a statement please help System.gc(); } } } public class timer { public static void main(String[] args) { Timer timer = new Timer(); GCTask task = new GCTask(); timer.schedule(task, 1000, 1000); int counter = 1; while (true) { try { Thread.sleep(500); } catch (InterruptedException e) { } } }
- 06-08-2011, 11:31 PM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,561
- Rep Power
- 11
A statement doing what? What is the line supposed to do? (at the moment it adds one and gamelength then does nothing with the resulting sum)
- 06-08-2011, 11:38 PM #3
Member
- Join Date
- Jun 2011
- Posts
- 2
- Rep Power
- 0
basically what it's going to do is it's going to be in a loop that starts when the on button is pushed and it gets +1 for each second that passes until the off button is pushed and this info is put live into a formula that creates an output that is desplayed in a text field
- 06-09-2011, 12:24 AM #4
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,561
- Rep Power
- 11
Yes, but none of that says what the statement you wish to write is supposed to do. (Not the context of the statement, not that "it" - whatever it is - gets something, not what later happens to some "info")
Is it - the statement - supposed to assign a value to a variable, perhaps? In java you use = for that:
Java Code:foo = someExpression;
- 06-09-2011, 12:52 AM #5
Similar Threads
-
if statement help
By Mrlowrider in forum New To JavaReplies: 1Last Post: 04-20-2011, 07:14 PM -
Help with If and Else statement
By Aionia in forum New To JavaReplies: 18Last Post: 03-13-2011, 07:50 AM -
add an If Else statement and......uh????
By sonny in forum New To JavaReplies: 6Last Post: 03-04-2010, 06:57 PM -
for statement help
By helpisontheway in forum New To JavaReplies: 5Last Post: 11-14-2009, 04:14 PM -
Statement or Prepared Statement ?
By paty in forum JDBCReplies: 3Last Post: 08-01-2007, 04:45 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks