Reputation: 435
Every time I create a new Java class inside a net beans project, I want to have the main method created automatically like the following:
package sorting;
/**
*
* @author me
*/
public class Sorting {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
}
}
Does anyone know how can I achieve this in NetBeans 8.0.2 ? I kind of navigated to Tools-->Options--->Editor
section but I was lost after that and couldn't figure out where to make the necessary changes. Could anyone please help me.
Thanks
Upvotes: 0
Views: 60
Reputation: 966
If you right click on the package in your project in the Netbeans Projects list, select New and then Other... In categories go to Java and in the right side list should be a file named Java Main Class.
The next time that you need it, it should be directly under New
But if you create a new class for your project, it doesn't need to have a main method, you just need a class.
Upvotes: 2