D
Dale Packwood
Hello,
The problem I'm having is that the below piece of code go through the if
statement twice and I can't fiqure out why. Could someone point me in the
right direction. Thanks
String from = fromdcntomcn.getFrompartnumber();
String to = fromdcntomcn.getMcnnumber();
String[] TOMCN = to.split("-");
String[] FROMMCN = from.split("-");
if (TOMCN[1].equals(FROMMCN[1])) {
System.out.println("Nice Job. Family numbers match. Please
continue. " + TOMCN[1]);
}
else {
System.out.println( "Sorry the family numbers did not match.
Please try again... " + TOMCN[1] + FROMMCN[1]);
}
return TOMCN[1];
}
The problem I'm having is that the below piece of code go through the if
statement twice and I can't fiqure out why. Could someone point me in the
right direction. Thanks
String from = fromdcntomcn.getFrompartnumber();
String to = fromdcntomcn.getMcnnumber();
String[] TOMCN = to.split("-");
String[] FROMMCN = from.split("-");
if (TOMCN[1].equals(FROMMCN[1])) {
System.out.println("Nice Job. Family numbers match. Please
continue. " + TOMCN[1]);
}
else {
System.out.println( "Sorry the family numbers did not match.
Please try again... " + TOMCN[1] + FROMMCN[1]);
}
return TOMCN[1];
}