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);
       }
    }
  • 相关阅读:
    JQuery-文档处理&选择器
    JQuery-事件(部分)
    JS中构造函数与函数
    JS中的String.Math.Date
    JS中的_proto_(2)
    JS中的_proto_
    JS中的constructor
    mysql 安装问题
    【转】SpringMVC中DispatcherServlet配置中url-pattern 配置/*和/的区别
    【转】MySql中的函数
  • 原文地址:https://www.cnblogs.com/tszr/p/10967180.html
Copyright © 2011-2022 走看看