zoukankan      html  css  js  c++  java
  • code review(互审)

    搭档代码的评审

    package Question;
    
    public class Q2 {
        private int maxRevolution;
        private int Revolution;
        private int gears;
        private double dia;
        private String colour;
        private String state;
    
        public Q2() {
    
        }
        
        
    
        public Q2(int maxRevolution, int revolution, int gears, double dia, String colour, String state) {
            super();
            this.maxRevolution = maxRevolution;
            Revolution = revolution;
            this.gears = gears;
            this.dia = dia;
            this.colour = colour;
            this.state = state;
        }
    
    
    
        public int getMaxRevolution() {
            return maxRevolution;
        }
    
        public void setMaxRevolution(int maxRevolution) {
            this.maxRevolution = maxRevolution;
        }
    
        public int getRevolution() {
            return Revolution;
        }
    
        public void setRevolution(int revolution) {
            Revolution = revolution;
        }
    
        public int getGears() {
            return gears;
        }
    
        public void setGears(int gears) {
            this.gears = gears;
        }
    
        public double getDia() {
            return dia;
        }
    
        public void setDia(double dia) {
            this.dia = dia;
        }
    
        public String getColour() {
            return colour;
        }
    
        public void setColour(String colour) {
            this.colour = colour;
        }
    
        public String isState() {
            return state;
        }
    
        public void setState(String state) {
            this.state = state;
        }
        
        
    
        @Override
        public String toString() {
            return "Fan [maxRevolution=" + maxRevolution + ", Revolution=" + Revolution + ", gears=" + gears + ", dia="
                    + dia + ", colour=" + colour + ", state=" + state + "]";
        }
    
    
    
        public static void main(String[] args) {
    
            Q2 status = new Q2();
            
            System.out.println(status);
        }
    }

    1.类名没有规范命名,随意命名没有意义

    2.方法的名称也是随意命名的

    3.没有注释

    4.部分定义的变量难以理解

    5.实例化对象,没有设值,mian方法执行的语句为空值,没有意义

  • 相关阅读:
    文章的上一页和下一页功能
    mysql的子查询in()操作及按指定顺序显示
    apache的配置详解
    mysql replace()用法
    js判断手机登陆用户
    mysql的常用函数
    mysql substring_index()查询某个字符中以某个分割符分割后的值
    mysql复制表数据,多表数据复制到一张表
    mysql数据去重复distinct、group by
    js获取站点根目录
  • 原文地址:https://www.cnblogs.com/krylova/p/6613501.html
Copyright © 2011-2022 走看看