在 Intellij IDEA 中使用快捷方式和自动完成功能创建新对象的最佳方法是什么? [英] What's the best way to use shortcuts and autocomplete to create a new object in Intellij IDEA?

查看:47
本文介绍了在 Intellij IDEA 中使用快捷方式和自动完成功能创建新对象的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Object + shortcutObject object = new Object();

有没有这样的捷径?

推荐答案

new ObjTab完成到new Object()Ctrl+Alt+V(重构 | 引入变量):

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

Object o = new Object();

根据需要更改名称,然后按 Enter 确认.

Change name if needed and press Enter to confirm.

要使用实时模板功能更方便的解决方案,请检查下面的答案来自@MarcG.

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

这篇关于在 Intellij IDEA 中使用快捷方式和自动完成功能创建新对象的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆