Convert boolean to int in Java September 20, 2022 by Tarik int myInt = myBoolean ? 1 : 0; ^^ PS : true = 1 and false = 0