Home > Net >  Change default template for new java class in IntelliJ
Change default template for new java class in IntelliJ

Time:04-17

When I create a new .java class in IntelliJ or any other idea besides blueJ it just starts off with

public Class app {

}

Is there a way to set it to open with something different like an MVC Architecture template like this?

public class App{

    private int x;

    /**
     * Constructor for objects of class App
     */
    public App()
    {
 
    }

    /**
     * An example of a method - replace this comment with your own
     *
     * @param  y  a sample parameter for a method
     * @return    the sum of x and y
     */
    public int sampleMethod(int y)
    {
        // put your code here
        return x   y;
    }
}

CodePudding user response:

You can edit Java Class template under Preferences | Editor | File and Code Templates > Files > Class

Here is the documentation page describing that functionality

  • Related