Switch Statement gives Incompatible Types error

前端 未结 5 1051
长发绾君心
长发绾君心 2020-12-11 03:25

I am trying to compile and I get this error:

enigma/Rotor.java:30: incompatible types found : java.lang.String required: int     switch(name){
1 error
         


        
5条回答
  •  情歌与酒
    2020-12-11 03:51

    If you are using maven project then simply you can add following piece of code to ypur pom.xml and resolve your problem :

     
            
                
                    org.apache.maven.plugins
                    maven-compiler-plugin
                    
                        1.8
                        1.8
                    
                
            
        
    

提交回复
热议问题