21

Java: Cannot convert int to Boolean.
Me: Wait what?.. Ohhh *cries*

I've had too much Vitamin C / C++..
Not used to computer liking me and not letting me shot my head of.. I love you too, Java ..

Comments
  • 1
    I mean, you could use a Kotlin extension function.

    def Int.toBoolean() = (this != 0)
  • 0
    With these kind of staticly typed languages, I use some manual conversions:

    Int -> Bool:
    myBool = (myInt == 1);

    Bool -> Int:
    myInt = (myBool ? 1 : 0);
  • 1
    Tbf. This is how it should be... types exist for a reason y’all.
Add Comment