JAVA 回答

来源:百度知道 编辑:UC知道 时间:2024/06/27 07:54:42
class testReload{
testReload(){
System.out.println("show something");
}
testReload(int i ){
this("1");
System.out.println("show integer");

}
testReload(String s ){
this();
System.out.println("show string");

}
public static void main(String args[]){
System.out.println("show begin");
testReload test1 = new testReload(1);
}
}

2.
class q {
public static void main(String args[]) {
new q();
}
q() {
divide(4,2);
divide(4,0);
}
public void divide(int a,int b) {
try{
int c=a/b;
System.out.println(c);
}
catch(Exception e){
System.out.println("error");
}
finally{
System.out.println("done");
}
}
}
3.
public class BreakAndContinue{

第2个代码答案C=2,接着是error
第3个好象是错的
第4个不知道什么意思
呵呵,我JAVA只自学了1个月,帮不到你了

你把问题描述清楚行不啊?程序倒是看的很清楚,可是你要干什么啊?

答对什么啊?
说清楚点啊

你什么意思 ,叫我们帮你做什么啊