简体   繁体   中英

What is the fastest/most effective way to create a “new ArrayList” in IntelliJ IDEA

My goal is to type the following statement as fast/effective as possible using IntelliJ IDEA:

List<String> list = new ArrayList<>();

This is what I tried:

  • use code completion List<String> list = new | , but too much to type
  • use post fix code completion new ArrayList<>().var| , but still too much to type

Note | means Code complete here

In NetBeans there is a simple template like "al", which creates the statement above. I did not found such a live template in IDEA for that. Did I miss an important usage pattern in IDEA?

EDIT: That is not a dumb noobie question. I recently switched to IDEA and haven't grasp all things to be productive. Yes, I could define my own live template and then persist it in a configuration file to share it with my working computer or create a plugin, which provides my template. But that is not the question. Is there a fast standard/built-in way to do it?

You can create your own templates if you feel you need more to what IntelliJ provides

Read this link on IntellJ on code completion

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM