What's the best way to use shortcuts and autocomplete to create a new object in Intellij IDEA?

后端 未结 3 1864
暗喜
暗喜 2020-12-05 10:54

Object + shortcutObject object = new Object();

Whether there is such shortcut?

3条回答
  •  眼角桃花
    2020-12-05 11:47

    new Obj, Tab to complete to new Object(), Ctrl+Alt+V (Refactor | Introduce Variable):

    Object o = new Object();
    

    Change name if needed and press Enter to confirm.

    For the more convenient solution utilizing the live templates feature please check the answer below from @MarcG.

提交回复
热议问题