int sum=0;
for(int x:nums){
sum+=x;
}
return((float)sum)/nums.length;
}
public static void main(String args[]){
Calculation cal=new Calculation();
float av1=cal.avg(10,20,30);
System.out.println(av1);
}
}
10.package test;
public class OuterClass{
private class InterClass{
public InterClass(){
System.out.println(“InterClass”);
}
}
public OuterClass(){
InterClass ic=new InterClass();
System.out.println(“OuterClass”);
}
public static void main(String args[]){
OuterClass oc=new OuterClass();
}
}
11.import java.io.*;
public class FileTest{
public static void main(String args[]){
File f=new File("document","old");
File d=new File("target");
d.mkdir();
f.renameTo(new File("target","new"));
String l[]=d.list();
for(int i=0;i System.out.println(l[i]); } } 12.interface ShowMessage{void显示商标(String s);}