im trying this code but it didn't work, the code should ask you for number again and agin until you enter a positive number. Sorry for my bad english, tnx !
System.out.print("Precio: ");
precio[contPre] = Double.parseDouble(teclado.readLine());
try {
double precioCatch = Double.parseDouble(String.valueOf(precio[contPre]));
if (precioCatch < 0)
throw new Exception();
}catch (Exception e) {
System.out.println("Number must be >0");
continue;
}