Originally Posted by
Joy4hacks
String tin[] = timeIn.split(":");
String tout[] = timeOut.split(":");
hours += ( Double.parseDouble(tout[0]) - Double.parseDouble(tin[0]) ) >= 9 ? 8 : Double.parseDouble(tout[0]) - Double.parseDouble(tin[0]);
someone tell me what this means?..i dont understand the part " 9 ? 8 : Double.parseDouble(tout[0]) - Double.parseDouble(tin[0]);
currently practicing java.
pls answer me guys..
This is a very rare expression, which barely gets used sadly enough.
It's basically the same as:
Code:
if(expression){
}else{
}
So here you have:
Code:
if(double - double >=9){
hours+=8;
}else{
hours+=double-double;
}