![]() |
program help
Code:
import javax.swing.*;Now i got a problem, u c my boolean method, well what i want to say is when its not a positive number then it should re prompt the user for a number(input = JOptionPane.showInputDialog(null, "Enter a positive integer") But right now its not workin correctly. can someone just help me wit that? thanx |
Re: program help
You have to simply use the continue statement after checking for positive number. Find the rectified code below.
Code: Java
|
Re: program help
thanks man, helped alot.
|
Re: program help
problem, its saying: variable another might not have been initialized but it is. Wat do i do?
|
Re: program help
i need some help, its not workin.... HELP... it just doesnt want to do wat i ask it to do????
|
Re: program help
Code:
import javax.swing.*;HOW DO I STOP THAT?? or any other ideas. thanks |
Re: program help
But I already gave you the solution, didn't you try that?
|
Re: program help
it said variable already may not have been initialized??
|
Re: program help
??? wats wrong wit it?
|
Re: program help
With the continue statment you can send it to the beginning of the loop everytime a specific condition is not satisfied, in your case a positive integer.
|
| All times are GMT +5.5. The time now is 15:33. |