IDEA quickly adds constructors, Setter methods, and Getter methods in classes

IDEA quickly adds constructors, Setter methods, and Getter methods in classes

IDEA top navigation bar - select Code- Generate, as shown in the figure below.
insert image description here

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.
insert image description here
In the pop-up interface, select the attribute to which the get method needs to be added, and click OKthe button to complete the addition.
insert image description here

Guess you like

Origin blog.csdn.net/u010804417/article/details/130601296