How to automatically generate getters and setters in Android Studio

后端 未结 15 1243
太阳男子
太阳男子 2020-12-02 04:15

Is there a shortcut in Android Studio for automatically generating the getters and setters in a given class?

15条回答
  •  心在旅途
    2020-12-02 05:05

    Position the cursor under the variables -> right-click -> Generate -> Getter and Setter -> Choose the variables to make the get and set

    or

    Alt + Insert -> Getter and Setter -> Choose the variables

提交回复
热议问题