阅读以下程序,给出运行结果。classA{publicstaticvoidmain(Stringargs[]){intj=0;for(inti=1;i<
阅读以下程序,给出运行结果。
classA{
publicstaticvoidmain(Stringargs[]){
intj=0;
for(inti=1;i<=10;i++){
j=j+i;
}
System.out.println("j="+j);
}
}
运行结果是:
阅读以下程序,给出运行结果。
classA{
publicstaticvoidmain(Stringargs[]){
intj=0;
for(inti=1;i<=10;i++){
j=j+i;
}
System.out.println("j="+j);
}
}
运行结果是:
阅读以下程序,给出运行结果。
classPerson{
Person(){
System.out.print("Thisisaperson.");
}
}
publicclassStudentextendsPerson{
Student(){
System.out.print("Thisisastudent");
}
publicstaticvoidmain(String[]args){
Studentstu=newStudent();
}
}
运行结果是:
阅读以下程序,填写运行结果()。 dic={'a':2,'b':1,'c':3} print(max(dic.values()))
阅读以下程序,填写运行结果()。lst=[11,12,13,14,15] lst.sort(reverse=True,key=lambda x:x%7) print(lst[1])
阅读以下程序,填写运行结果()。def fun(a,b,*c): lst=[] for i in c: lst.append(a*b*i) return lst print(fun(2,3,4,5,6)[1])
阅读以下程序,填写运行结果()。lst=[(1,3),(4,2),(6,8),(3,0)] lst.sort(key=lambda i:i[0]*i[1]) print(lst[-1])
阅读以下程序,给出运行结果。
classMultiCatch{
publicstaticvoidmain(Stringargs[]){
try{
inta=args.length;
intb=44/a;
intc[]={2,6};
c[44]=100;
System.out.println("b="+b);
}catch(ArithmeticExceptione){
System.out.println("除0异常");
}catch(ArrayIndexOutOfBoundsExceptione){
System.out.println("数组超越边界异常");
}finally{
System.out.println("程序执行结束");
}
}
}
运行结果是: