nameClass.main is how it shows up in the new project dialog. It just means that it will create a main class inside the the package name you gave it like this nameClass.main. Package is nameClass and main.java will be the class with a main method in it.
You may name things any way you want. Just leave it blank and use right click context menu new or file menu new later. There are all kinds of templates you can use like blank .java or new class.java and even new main class.java You can do things before the project gets generated or after. That's how versatile NetBeans is. Don't be afraid to experiment with each just to see. You can always delete them. Now the difference is that if you want nameClass.java in the first place then you should enter that in Create Main Class textbox as nameClass leaving the java part off. That will make a file nameClass.java in your source package with a main method in it. I like to call it a method because it does have parameters that can be passed in from the command line and has void return type. Don't you mean you need a class called Name with a main method in it? You should try to keep your class names camel cased and your package names dot separated like this com.my.example. Is there any home work you can reference your question to so we get a better idea of your question? On Aug 21, 2:40 pm, Béatrice [email protected] <[email protected]> wrote: > Hi > > During homeworks, we had to create classes :for example > nameClass.java with a main class in it, and nameClass.main. > Can someone tell me the difference ? > When we begin a project in java, which one do we have to create ? > I just begin in java and I'm not sure to do well. > Thank you for your help. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---
