Android 2.1 switch loop JRE 1.7
        Posted  
        
            by 
                Defuzer
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Defuzer
        
        
        
        Published on 2012-09-03T11:44:50Z
        Indexed on 
            2012/09/03
            21:38 UTC
        
        
        Read the original article
        Hit count: 195
        
android
Hello how to use switch loop in my android project ? I want to use Android 2.1
I need JRE 1.7, but I want to use Android 2.1
I use loop like this:
switch ((CHAR[Math.abs(intGen.nextInt()%2)])) {
    case "+":
        result = random2 + random3;
        break;
    case "-":
        result = random2 + random3;
        break;
} 
LogCat:
Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted
        © Stack Overflow or respective owner