What is the most accepted way to convert a boolean to an int in Java?
boolean
int
int myInt = myBoolean ? 1 : 0;
^^
PS : true = 1 and false = 0
1.4m articles
1.4m replys
5 comments
57.0k users