How do I change boolean to int?

Asked 2 years ago, Updated 2 years ago, 143 views

What is the best way to change boolean to int?

java casting boolean int

2022-09-22 22:21

1 Answers

int myInt = (myBoolean) ? 1 : 0; 1 is true and 0 is false.


2022-09-22 22:21

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.