集册 Java实例教程 记录您的代码

记录您的代码

欢马劈雪     最近更新时间:2020-01-02 10:19:05

474
提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
使用Javadoc将注释放在要记录的任何类,方法或字段之前。
/* from 
时 代 J a v a*/

import java.math.BigInteger; 


public class Main { 

    /** 

     * Accepts an unlimited number of values and 

     * returns the sum. 

     * 

     * @param nums Must be an array of BigInteger values. 

     * @return Sum of all numbers in the array. 

     */ 

     public static BigInteger addNumbers(BigInteger[] nums) { 

         BigInteger result = new BigInteger("0"); 

         for (BigInteger num:nums){ 

             result = result.add(num); 

         } 


         return result; 

     } 
     /**来自 
      NowJava.com - 时  代  Java**/

    /** 

     * Test the addNumbers method. 

     * @param args not used 

     */ 

     public static 
展开阅读全文