zoukankan      html  css  js  c++  java
  • 吴裕雄--天生自然 JAVA开发学习:文档注释

    /*** 这个类绘制一个条形图
    * @author runoob
    * @version 1.2
    */
    import java.io.*;
     
    /**
    * 这个类演示了文档注释
    * @author Ayan Amhed
    * @version 1.2
    */
    public class SquareNum {
       /**
       * This method returns the square of num.
       * This is a multiline description. You can use
       * as many lines as you like.
       * @param num The value to be squared.
       * @return num squared.
       */
       public double square(double num) {
          return num * num;
       }
       /**
       * This method inputs a number from the user.
       * @return The value input as a double.
       * @exception IOException On input error.
       * @see IOException
       */
       public double getNumber() throws IOException {
          InputStreamReader isr = new InputStreamReader(System.in);
          BufferedReader inData = new BufferedReader(isr);
          String str;
          str = inData.readLine();
          return (new Double(str)).doubleValue();
       }
       /**
       * This method demonstrates square().
       * @param args Unused.
       * @return Nothing.
       * @exception IOException On input error.
       * @see IOException
       */
       public static void main(String args[]) throws IOException
       {
          SquareNum ob = new SquareNum();
          double val;
          System.out.println("Enter value to be squared: ");
          val = ob.getNumber();
          val = ob.square(val);
          System.out.println("Squared value is " + val);
       }
    }
  • 相关阅读:
    基础表达式和运算符
    原型链(_proto_) 与原型(prototype) 有啥关系?
    插件模板
    加减plugin
    原生选项卡、手风琴
    前端基础问题(有答案)
    结构图
    Java环境配置小记
    函数
    砝码称重
  • 原文地址:https://www.cnblogs.com/tszr/p/10967180.html
Copyright © 2011-2022 走看看