zoukankan      html  css  js  c++  java
  • 简单java应用程序备录

    public class B
    {
       public static void main(String args[])
    {
       Rect A=new Rect();
       Rect C=new Rect(3,5);
       System.out.println(A.computerArea()+' '+C.computerGirth());
       System.out.println(C.computerGirth()+' '+A.computerArea());
    }
    }
         
     
    class Rect
    {
       double sideA,sideB;
       double sideC,sideD;
       Rect()
    {   this.sideA=3.0;
        this.sideB=3.0;
    }
       Rect(double a,double b)
    {
         sideC=a;
         sideD=b;
    }
       double computerArea()

         return sideA*sideB;

        double computerGirth()
    {
         return (sideC+sideD)/2;
    }
    }

      

  • 相关阅读:
    Core Java 5
    pyDay11
    c++第二十一天
    pyDay10
    c++第二十天
    RadioButton控件
    ListBox控件
    Image控件
    FileUpload控件
    DropDownList控件
  • 原文地址:https://www.cnblogs.com/xiohao/p/2742334.html
Copyright © 2011-2022 走看看