java - explain this line of code android -
i beginner android, looking @ tutorial , came accross code:
int temp = (sensor.gettype() == sensor.type_accelerometer) ? 1 : 0;
can 1 explain me.
may question duplicate, don't know search for. great if can tell me in c# aswell.
(sensor.gettype() == sensor.type_accelerometer) ? 1 : 0;
means
int result; if (sensor.gettype() == sensor.type_accelerometer) result = 1; else result = 0;
Comments
Post a Comment