public static String checkStatus(String status) { while((状态!=" s" ||状态!=" S" ||状态!=" m" ||状态!=
//this line is in the main program
marital = checkStatus(marital);
//this is a method that keep asking for s or m if user input is not s or m
public static String checkStatus(String status)
{
while(status != "s" || status != "S" || status != "m" || status != "M")
{
status = JOptionPane.showInputDialog(null, "Please enter M or S for marital status: ");
}
return status;
}

" M&#34)) { status = JOptionPane.showInputDialog(null,"请输入M或S表示婚姻状况:");
}
return status;
}
//我不断得到一个要求m或s的无限循环