IDEA quickly generate the get / set body


IDEA quickly generate the get / set body

  • Method 1. alt + enter automatically created at the bottom, more convenient, but the need to move the cursor to a specified variable;
  • Method 2. Right Generate / alt + insert without first specified variable, but need to make sure the output variables and output over the method body in variable declaration;

Method 1. alt + enter

  1. Move the cursor to specify a variable name, press the alt + enter;
    1.1
  2. Select output method thereof, where the selected Create getter and setter for 'name', generates a corresponding set / get the method under the variables declared in the body;
    1.2

Method 2. Right Generate / alt + insert

  1. Right select Generate, or by alt + insert;
    2.1
  2. Select output method thereof, where the selected Getter and Setter;
    2.2
  3. Select the variable to be output;
    2.3
  4. Generating method body above the variable declaration;
    2.4
Published 59 original articles · won praise 60 · views 1586

Guess you like

Origin blog.csdn.net/Regino/article/details/104542649