Estou com o seguinte problema:
public static void main(String[] args) {
String nome[] = new String[100];
byte dados[][] = new byte[100][3];
String str = "";
while (true) {
for (int cont = 1; cont <= 100; cont++) {
str = JOptionPane.showInputDialog("Nome da " + cont + "° pessoa");
Pattern seleção = Pattern.compile("[0-9]");
Matcher resultado = seleção.matcher(str);
if (str == null) {
break;
} else if (str.length() < 5 || str.length() > 50) {
JOptionPane.showMessageDialog(null, "O nome deve ter de 5 a 50 caracteres!", "ERRO", 0);
} else if (resultado.find()) {
JOptionPane.showMessageDialog(null, "O nome não deve conter numeros!", "ERRO", 0);
} else {
nome[cont] = str;
str = "";
}
while (true) {
char estadoCivil;
str = JOptionPane.showInputDialog(null, "Estado civil da" + cont + "° pessoa:\n"
+ "S = Solteiro(a)\nC = Casado(a)\nV = Viúco(a)\nD = Divorciado(a)\nO = Outros");
char codCivil = str.charAt(0);
int temp = codCivil;
switch (str.toUpperCase()) {
case "S":
dados[cont][0] = (Byte) Byte.parseByte(temp);
break;
case "C":
dados[cont][0] = Byte.parseByte(str);
break;
case "V":
dados[cont][0] = Byte.parseByte(str);
break;
case "D":
dados[cont][0] = Byte.parseByte(str);
break;
case "O":
dados[cont][0] = Byte.parseByte(str);
break;
default:
JOptionPane.showMessageDialog(null, "Opção inválida", "ERRO", 0);
}
}
}
}
}
no código acima, estou com erro nessa linha, dados[cont][0] = (Byte) Byte.parseByte(temp); , alguem saberia como posso resolver?