新建类 求最大值,将所有的方法都写在main方法中 求最大值用一个方法封装起来 把刚才的步骤综合到一个方法里,低于main方法来说怎么计算最大值呢? 如果把for循环换成white循环对外界的调用没有任何的影响。外界只管调用拿结果就可以了。 这就是对细节步骤进行隐藏封装起来