Confusing case behavior with java static int

I'm confused ... this static value is 5

user> java.awt.image.BufferedImage/TYPE_3BYTE_BGR
5

and the case statement should work as follows

user> (case 5
        5 "yes"
        "huh?")
"yes"

but why does it work like that? Why is this not appropriate?

user> (case java.awt.image.BufferedImage/TYPE_3BYTE_BGR
            java.awt.image.BufferedImage/TYPE_3BYTE_BGR "yes"
            "huh?")
"huh?"
+5
source share
1 answer

test-constantin the expression is casenot evaluated. Therefore, your operator checks to see if the number matches the 5character java.awt.image.BufferedImage/TYPE_3BYTE_BGR. Since this is not the case, he moves on to the default sentence.

+6
source

All Articles