JAVA大学实用教程(第二版)附课后练习答案 第5章 继承、接口与泛型.ppt

JAVA大学实用教程(第二版)附课后练习答案 第5章 继承、接口与泛型.ppt

JAVA大学实用教程(第二版)附课后练习答案 第5章 继承、接口与泛型

* * * * * * * * * * * * * * * * * * * * * * * * * * * * 第五章 问答题 return message; } } class MaxCommonDivisor{ public int getMaxCommonDivisor(int a, int b)throws NegativeIntegerException{ if(a0||b0) throw new NegativeIntegerException(); 第五章 问答题 int r=0; if(ab){ int t=a; a=b; b=t; } r=a%b; while(r!=0){ a=b; 第五章 问答题 b=r; r=a%b; } return b; } } class MinCommonMultiple extends MaxCommonDivisor{ public int getMinCommonMultiple(int a, int b)throws NegativeIntegerException{ 第五章 问答题

文档评论(0)

1亿VIP精品文档

相关文档