About Question enthuware.ocajp.i.v7.2.860 :
Posted: Wed Nov 28, 2012 6:34 pm
public void switchString(String input){
switch(input){
case "a" : System.out.println( "apple" );
case "b" : System.out.println( "bat" );
break;
case "B" : System.out.println( "big bat" );
default : System.out.println( "none" );
}
}
public static void main(String[] args) throws Exception {
TestClasstc = new TestClass();
tc.switchString("B");
}
hi according to eclipse switch cannot evaluate string so this won't compile....
switch(input){
case "a" : System.out.println( "apple" );
case "b" : System.out.println( "bat" );
break;
case "B" : System.out.println( "big bat" );
default : System.out.println( "none" );
}
}
public static void main(String[] args) throws Exception {
TestClasstc = new TestClass();
tc.switchString("B");
}
hi according to eclipse switch cannot evaluate string so this won't compile....