user3158925
user3158925

Reputation: 41

Is it possible to use already String in Switch?

I heard that the new version of Java String made ​​support in the operator Switch. Does it work now in Android?

Upvotes: 0

Views: 71

Answers (1)

m0skit0
m0skit0

Reputation: 25873

No. switch/case for String is only available for Java 7+, and Android Dalvik is based on Java 6.

EDIT: note that starting with API 16 there are some Java 7 features included, check this other answer.

Upvotes: 2

Related Questions