zoukankan      html  css  js  c++  java
  • java学习50天2020/8/24

    import java.util.Scanner;
    public class Rectangle {
        private int length; //矩形的长
        private int width;  //矩形的宽
         public Rectangle() {
         }
         public Rectangle(int length, int width) {
            this.length = length;
             this.width = width;
        }
         public void area() {
             int s;
             s=length*width;
             System.out.println("矩形面积:"+s);
         }
         public static void main(String[] args) {
             Scanner in=new Scanner(System.in);
             int a,b;
             System.out.print("请输入矩形的长和宽:");
             a=in.nextInt();
             b=in.nextInt();
             Rectangle r=new Rectangle(a,b);
             r.area();
         }
     }
    

     

    public class DataType {
        private char s; 
        private int a;   
        private double b; 
        public DataType() {
        }
         public DataType(char s, int a, double d) {
             this.s = s;
             this.a = a;
            this.b = d;
         }
         public void display() {
             System.out.println("字符型:"+s);
            System.out.println("整型:"+a);
             System.out.println("浮点型:"+b);
         }
         public static void main(String[] args) {
             DataType p=new DataType('s',5,5.2);
             p.display();
         }
     }
    

     

    三.例题

  • 相关阅读:
    EF--CodeFirst
    一个很吊的文章---框架
    EF的代码优先设计
    MVC3--View层
    asp.net返回值当文件下载问题
    MVC源码
    编译原理
    TPatch动态补丁系统(iOS)
    浅析分布式系统
    如何在腾讯云快速构建一个Wordpress个人站点
  • 原文地址:https://www.cnblogs.com/qiangini/p/13583406.html
Copyright © 2011-2022 走看看