zoukankan      html  css  js  c++  java
  • My parnter code review

    1.建议修改的代码:

    public class Jiemian extends JFrame {
     23 
     24     private JPanel contentPane;
     25     
     26     
     27         private JTextField username;
     28         private JTextField email;
     29         private JPasswordField password;
     30         private JLabel man;

    意见:这个类的名字太过随意,可能有时候让人不理解

    修改如下:

     22 public class interface extends JFrame {
     23 
     24     private JPanel contentPane;
     25     
     26     
     27         private JTextField username;
     28         private JTextField email;
     29         private JPasswordField password;
     30         private JLabel man;

    2.建议修改的代码:

    150                         switch (n) {
    151                    case 0:
    152                    JOptionPane.showMessageDialog(button_1,
    153                    "用户名:" + name1 + "
    " + "性别:"  xb + "
    " + "电子邮件:"  mail + "
    " + "爱好:" + role1);
    154                         }
    155             }
    156 
    157                 }
    158             });

    意见:大括号的位置随意摆放,凌乱

    修改如下:

    150                         switch (n) {
    151                     case 0:
    152                     JOptionPane.showMessageDialog(button_1,
    153                     "用户名:" + name1 + "
    " + "性别:" xb + "
    " + "电子邮件:"  mail + "
    " + "爱好:" + role1);
    154             }
    155         }
    156 
    157      }
    158    });

    3.建议修改的代码:

                            switch (n) {
    151               case 0:
    152               JOptionPane.showMessageDialog(button_1,
    153               "用户名:" + name1 + "
    " + "性别:" xb + "
    " + "电子邮件:"  mail + "
    " + "爱好:" + role1);
    154                         }
    155             }
    156 

    意见:行的长度,缩进有问题,看着不舒服,还有符号也漏掉了

    修改如下:

                                 switch (n) {
    151                          case 0:
    152                             JOptionPane.showMessageDialog(button_1,
    153                             "用户名:" + name1 + "
    " + "性别:" + xb + "
    " + "电子邮件:" + mail + "
    " + "爱好:" + role1);
    154                         }
    155             }
    156 
  • 相关阅读:
    Spring static 静态属性注入
    大众点评Cat--架构分析
    rxjava
    TCP/IP协议三次握手与四次握手流程解析
    [SDOI2014]数数
    CF-GYM101741K. Consistent Occurrences
    [JSOI2012]玄武密码
    [POI2000]病毒
    [JSOI2007]文本生成器
    [HNOI2006]最短母串问题
  • 原文地址:https://www.cnblogs.com/LT1997/p/6613690.html
Copyright © 2011-2022 走看看