在 IntelliJ 中更改新 java class 的默认模板
Change default template for new java class in IntelliJ
当我在 IntelliJ 或除 blueJ 之外的任何其他想法中创建一个新的 .java class 时,它只是从
开始
public Class app {
}
有没有办法将它设置为使用不同的东西打开,比如像这样的 MVC 架构模板?
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;
}
}
您可以在 首选项下编辑 Java Class 模板 |编辑|文件和代码模板 > 文件 > Class
这是描述该功能的documentation page
当我在 IntelliJ 或除 blueJ 之外的任何其他想法中创建一个新的 .java class 时,它只是从
开始public Class app {
}
有没有办法将它设置为使用不同的东西打开,比如像这样的 MVC 架构模板?
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;
}
}
您可以在 首选项下编辑 Java Class 模板 |编辑|文件和代码模板 > 文件 > Class
这是描述该功能的documentation page