-
-
-
阅读下列程序,写出程序运行结果。interface Computable{final int MAX=100;int f(int x);int g(int x,int y);}class Aa implements Computable{int no;public int f(int x){int sum=0;for(int i=1;i<=x;i++)sum=sum+i;return sum;}public int g(int x,int y){return x*y;}}class Bb implements Computable{int no;public int f(int x){int sum=0;for(int i=1;i<=x;i++)sum=sum+i*i;return sum;}public int g(int x,int y){return x+y;}}public class Class3204{public static void main(String[] args){Aa li;Bb tom;li=new Aa();li.no=851898;tom=new Bb();tom.no=951899;System.out.print("Li的编号"+li.no+","+li.MAX);System.out.println(","+li.f(3)+","+li.g(3,4));System.out.print("Tom的编号"+tom.no+","+tom.MAX);System.out.print(","+tom.f(3)+","+tom.g(3,4));}}
-
-
-
-
-
-
-