我正在做这个小程序,但不幸的是我遇到了这个问题..
if (ccnString.charAt(0) != '4' || ccnString.charAt(0) != '3') {
System.out.println("The String entered does not fit any of the Credit card standards");
System.exit(0);
}
如果我在我的字符串中放入任何整数,我的程序无法识别。
但是,如果我删除我的 || 最后一部分,if 语句识别第一个整数。
我在这里想念什么?