How do I make a java method that accepts only positive integer and if user enters negative integer then it re-prompts to enter from main method or go back to main method to input... This was all that I was able to figure out:
public class error5
{
public void error5(int quantity){
if (quantity <=0){
System.out.println("**Error5**- Quantity on hand is negative value");
System.out.print("Enter quantity on hand: ");
break;
}
else {
System.out.print("");
break;
}
}
}
What to do next?