I
I
Ivan Trofimov2014-05-30 09:19:41
Java
Ivan Trofimov, 2014-05-30 09:19:41

Why can't you use String in switch in java?

Why? I write if-ami - everything is fine. I wanted to implement the construction through switch, android-studio strongly recommends using if and refuses to compile.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bimeg, 2014-05-30
@cbone

switch on strings appeared only in Java 7.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question