首页 > 代码库 > code review(互审)
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方法执行的语句为空值,没有意义
code review(互审)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。