Thursday, July 21, 2011

Incompatible types - found java.lang.String but expected int?

you can switch only value type variables like int, char etc. but String is a class or a reference type. Since you are entering only one character you can use char clr; and clr = br.read(); and case 'B', within single quotes

No comments:

Post a Comment