How to generate serial version UID in Intellij

前端 未结 5 1590
情深已故
情深已故 2021-01-30 01:45

When I used Eclipse it had a nice feature to generate serial version UID.

But what to do in IntelliJ?

How to choose or gen

5条回答
  •  长情又很酷
    2021-01-30 02:26

    Easiest method: Alt+Enter on

    private static final long serialVersionUID = ;
    

    IntelliJ will underline the space after the =. put your cursor on it and hit alt+Enter (Option+Enter on Mac). You'll get a popover that says "Randomly Change serialVersionUID Initializer". Just hit enter, and it'll populate that space with a random long.

提交回复
热议问题