Help❓ Java Code time in and time out

Posts 1–2 of 2 · Page 1 of 1
❓ Java Code time in and time out
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..
Quote Originally Posted by Joy4hacks View Post
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;
}
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

Talk with us