javabean 一些这方面的快捷键

  • Post author:
  • Post category:java

javabean 一些这方面的快捷键

 

1.生成带参和get和set alt+fn+insert (跳出页面自己选)

2.ctrl+a是全选

3.ptg插件 一秒生成JavaBean idea已经安装好 鼠标右键ptg to javabea就ok了

package pxc.cn;
public class user {
//写一个标准Javabean
    //属性
    private String name;
    private String password;
    private String yx;
    private String gender;
    private int age;
     //生成带参和get和set    alt+fn+insert  (自己选)     ctrl+a是全选     ptg插件 一秒生成JavaBean
    public user() {
    }

    public user(String name, String password, String yx, String gender, int age) {
        this.name = name;
        this.password = password;
        this.yx = yx;
        this.gender = gender;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getYx() {
        return yx;
    }

    public void setYx(String yx) {
        this.yx = yx;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }


/*
    //空参    很简单 就一个public
    public  user(){}
    //含参
    public  user(String name,String password, String yx,String gender,int age){
        this.name=name;
        this.password=password;
        this.yx=yx;
        this.gender=gender;
        this.age=age;
    }
    //get set
    public void setName(String name){
        this.name=name;
    }
    public String getName(){
        return name;
    }

    public void setPassword(String password){
        this.password=password;
    }
    public String getPassword(){
        return password;
    }

    public void setGender(String gender){
        this.gender=gender;
    }
    public String getGender(){
        return gender;
    }*/
}


版权声明:本文为m0_67911983原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。