最赞回答 / 慕先生4962489
String player_v1Name=players.player.get(players.playerID[0]);这个代码我有点绕晕了,能不能帮我解释一下,谢谢!
2016-02-08
已采纳回答 / hainishishui
第二个问题问的好!同求!对于以上四个问题我的理解是这样的:1、包装的异常类应该是Exception的子类,至于使用RuntimeException类应该是举个例子,使用现有的子类的方法比较方便。2、Exception e的实例化个人感觉应该是由虚拟机实现的3、RuntimeException类是Exception类的子类,都在java.lang包中,java编译器自动加载了java.lang包的内容4、这个可以查查api
2016-02-05
已采纳回答 / okgermany
public class ExceptionTest { public void divide(int one,int two) throws Exception{ if(two==0) throw new Exception("两数相除,除数不能为0."); else System.out.println("两数相除结果为:"+one/two); } public void computer(){ try{ divide(5,0); }c...
2016-02-05
最赞回答 / 司马长卿
// 创建新的学生对象 Student newStudent = new Student(ID, name); // 通过调用students的put方法,添加ID-学生映射 students.put(ID, newStudent);为什么新建的学生对象里面已经有了ID和name 两个参数了。在put方法里面还要添加ID这个属性?
2016-02-05
// 从后往前每隔三位插入逗号
for(int i = str.length()-3; i>0; i-=3){
str.insert(i,",");
}
for(int i = str.length()-3; i>0; i-=3){
str.insert(i,",");
}
2016-02-04