首页 > 代码库 > My parnter code review
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 + "\n" + "性别:" xb + "\n" + "电子邮件:" mail + "\n" + "爱好:" + role1); 154 } 155 } 156 157 } 158 });
意见:大括号的位置随意摆放,凌乱
修改如下:
150 switch (n) { 151 case 0: 152 JOptionPane.showMessageDialog(button_1, 153 "用户名:" + name1 + "\n" + "性别:" xb + "\n" + "电子邮件:" mail + "\n" + "爱好:" + role1); 154 } 155 } 156 157 } 158 });
3.建议修改的代码:
switch (n) { 151 case 0: 152 JOptionPane.showMessageDialog(button_1, 153 "用户名:" + name1 + "\n" + "性别:" xb + "\n" + "电子邮件:" mail + "\n" + "爱好:" + role1); 154 } 155 } 156
意见:行的长度,缩进有问题,看着不舒服,还有符号也漏掉了
修改如下:
switch (n) { 151 case 0: 152 JOptionPane.showMessageDialog(button_1, 153 "用户名:" + name1 + "\n" + "性别:" + xb + "\n" + "电子邮件:" + mail + "\n" + "爱好:" + role1); 154 } 155 } 156
My parnter code review
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。