When IDEA is in New Java Class, choose your own commonly used Class template

Effect: You
will see that I have one more ThreadClass template here. Let’s
Insert picture description here
create this template.
File | Settings | Editor | File and Code Templates.
Here I choose project. You can also choose default. This template here is just in It is often used in the current project, so I chose the project scope here
Insert picture description here
and copy the code below to the right side of the figure.

#if (${
    
    PACKAGE_NAME} && ${
    
    PACKAGE_NAME} != "")
package ${
    
    PACKAGE_NAME};   // 解决package
#end
#parse("File Header.java")
import lombok.extern.slf4j.Slf4j;
import static com.rh.bilibili.utils.Sleeper.sleep;
/**  
    * @Title: ${NAME}  
    * @Description:
    * @author:pzj
    * @date: ${DATE} ${TIME}
    */
@Slf4j(topic = "c.${NAME}")
public class ${
    
    NAME} {
    
    
        public static void main(String[] args) {
    
    
        new Thread(()->{
    
    },"t1").start();
    }
}

After completing the above preparations, when you right-click to create a new Java Class, our own commonly used templates will appear.
Insert picture description here
Reference: https://www.cnblogs.com/jason0529/p/13606595.html

Guess you like

Origin blog.csdn.net/Brave_heart4pzj/article/details/113814216