I do not understand what this statment is doing.
(minute==minuteFloor+1 ? TIME_PICKER_INTERVAL : 0)
could someone explain it or provide a link
Thank you.
I do not understand what this statment is doing.
(minute==minuteFloor+1 ? TIME_PICKER_INTERVAL : 0)
could someone explain it or provide a link
Thank you.
It's basically
if(minute == minuteFloor + 1) {
val = TIME_PICKER_INTERVAL;
} else {
val = 0;
}
myvariable = (minute==minuteFloor+1 ? TIME_PICKER_INTERVAL : 0)
In the above statement you used ?: operator which is called Ternary Operator.
it is used in below context:
if(condition)
{
//assign some value
}
else
{
//assign some other value
}
so your code does similar to below:
if(minute==minuteFloor+1)
{
myvariable=TIME_PICKER_INTERVAL;
}
else
{
myvariable=0;
}