How does IDEA quickly try/catch

  1. There is a piece of code in IDEA that will throw an exception. If try/catch is not used, there will be an error message. At this time, you need to use try/catch outside this code to catch exceptions.

    How does IDEA quickly try/catch

  2. Position the cursor on this code and press the shortcut key [CTRL+ALT+T].

    How does IDEA quickly try/catch

  3. Select the try/catch option in the menu that opens.

    How does IDEA quickly try/catch

  4. The editor then automatically wraps the try/catch block around that code block. Similar to try/catch/finally blocks and so on.

    How does IDEA quickly try/catch

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324148455&siteId=291194637