Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

Java version (switch)

$
0
0

Hello,

I posted my submit to http://www.codechef.com/problems/A3/. It works locally, but on this site I have compilation errors:

Main.java:75: incompatible types found : java.lang.String required: int switch (operator) { ^ Main.java:113: incompatible types found : java.lang.String required: int switch(operator) { ^ Main.java:189: incompatible types found : java.lang.String required: int switch(operator) { ^ 3 errors

They are connected with switch statement, in which I use String as argument. As far as I understand, this construction is not available in Java 6, but it is implemented in Java 7 (http://stackoverflow.com/questions/338206/switch-statement-with-strings-in-java). But on the CodeChef wiki page I see information that the Java compiler version is javac-1.7.0_25 (http://www.codechef.com/wiki/list-compilers). Is there something I missed?

Thanks to look at this.


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>