ligx
V2EX  ›  Java

Intellij IDEA 如何用快捷键为 Java 自动生成带参数的构造函数

  •  
  •   ligx · Jan 5, 2017 · 4640 views
    This topic created in 3591 days ago, the information mentioned may be changed or developed.

    Intellij IDEA 如何用快捷键为 Java 自动生成带参数的构造函数?

    6 replies  •  2017-01-06 14:07:46 +08:00
    zts1993
    zts1993
    Jan 5, 2017
    1
    alt+insert 然后选择 field...


    不过我推荐 lombok
    Lonely
    Lonely
    Jan 5, 2017
    2
    会搜索吗?
    aircjm
    aircjm
    Jan 5, 2017
    3
    @zts1993 lombok 不能热部署很不爽
    ligx
    ligx
    OP
    Jan 5, 2017
    4
    @zts1993 我需要源码中实实在在存在构造函数,因为需要在构造函数上加注解。有没有快捷键自动生成带参数的构造函数?
    twoyuan
    twoyuan
    Jan 5, 2017
    5
    @ligx 一楼的方法就可以啊,会弹出个对话框,然后选择参数就可以了,前提是参数已经定义为 member 了
    Ministor
    Ministor
    Jan 6, 2017
    6
    mac option+enter
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1525 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 23:04 · PVG 07:04 · LAX 15:04 · JFK 18:04
    ♥ Do have faith in what you're doing.