IDEA quickly adds constructors, Setter methods, and Getter methods in classes
IDEA top navigation bar - select Code
- Generate
, as shown in the figure below.
In the pop-up interface, select the corresponding method to be created as required, as shown in the following figure. Construction method selection Constructor
, get method selection for each attribute of this class Getter
, and set method selection for each attribute of this class Setter
.
In the pop-up interface, select the attribute to which the get method needs to be added, and click OK
the button to complete the addition.