this code doese not compile becauese if the method containing the switch statement is declared with a non void return type and if no return statement appears after the switch statement,the each case of the switch must have a return statement or a throw statement. Here,there is no return statement after the switch statement ,so all the cases
should have had a return or throw statement. the default case has no return
statement here. so the compiler will cmplain because assertions might not always be enabled.here, instead of assert false, you can use throw assertionerror which will be exceuted even if assertions are disabled.题目等下贴,现在手头还有点事情 谢谢了。
should have had a return or throw statement. the default case has no return
statement here. so the compiler will cmplain because assertions might not always be enabled.here, instead of assert false, you can use throw assertionerror which will be exceuted even if assertions are disabled.题目等下贴,现在手头还有点事情 谢谢了。
解决方案 »
- 问一下反射机制
- XML 节点数问题
- 道破天机——程序员教你如何把握经济大势
- JAVA新手求解一道算法题?得解马上结贴!
- 抽象类可以有构造函数吗?
- jcombobox弹出颜色选择的问题。
- 明天就要交作业了,谁能帮我打包一下好吗?急啊,谢谢大家了!!!!!!!!!
- 为什么在jbuilder中找不到javax.xml这个package
- 基于AbstractTableModel的JTable单元格编辑后直接更新问题, coolskeeter(蚊子)兄请进
- 关于import一个类的问题
- 问各位大侠,怎样实现输入一段英文,将单词间的空格缩减为一个?
- [优化]”输入数字,然后分别输出整数部分和小数部分“哪位大侠帮我优化一下呢?
他又说编译器可能没有允许断言,所以你可以抛出assertionerror,这个是一定会抛出的。