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

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -