Should the project name of my Java application ?

In summary, the project name of a Java application does not necessarily have to be the same as the name when saving the application. In Netbeans IDE 8.0.2, the compiler will automatically compile the file named GetStarted.java if it contains a main method. Pressing the green button will successfully compile and execute the application.
  • #1
Math10
301
0
Should the project name of my Java application must be the same as the name when I save my Java application? Because I'm using Netbeans IDE 8.0.2 and in the project name field, I put First Java Program and after I wrote the Java application, when I save it, I put GetStarted.java in the save as field. Is this okay? And how do I compile my Java application from here?
 
Technology news on Phys.org
  • #2
No, not necessarily.

You have a class named GetStarted in the file GetStarted.java, right? If it is your only class and there is a main method within that class you can compile it by just pressing the green button that has the shape of a triangle. In your case Netbeans will configure the compiler to compile said file (GetStarted.java). If you have more than one class with a main method, Netbeans will ask you which one you want to compile.
 
  • #3
Thank you for the help. I did as you said and got
run:
BUILD SUCCESSFUL (total time: 0 seconds)
in the output window in my IDE. So did I did this right?
 
  • #4
Yes, you did it right. ;)

However, if there was some code that printed text on the screen on the main method within GetStarted.java you should have seen that too.
 
  • #5
So in order to run (execute) a Java application, just press the green button that looks like a triangle and you're done, right?
 

Related to Should the project name of my Java application ?

1. What are the factors to consider when choosing a project name for my Java application?

Some factors to consider include the purpose of your application, the target audience, and the uniqueness of the name.

2. How important is the project name for the success of my Java application?

The project name can play a significant role in the success of your application as it can attract potential users and give them an idea of what your application is about.

3. Should I choose a short or a descriptive name for my Java application?

It is recommended to choose a name that is both short and descriptive. This will make it easy for users to remember and understand what your application does.

4. Can I change the project name of my Java application after it has been released?

Yes, it is possible to change the project name of your Java application after it has been released. However, it is not advisable as it can cause confusion among users and affect the branding of your application.

5. Are there any naming conventions or guidelines for choosing a project name for my Java application?

Yes, there are some recommended naming conventions for Java applications, such as using descriptive and meaningful names, avoiding special characters, and following the camel case naming convention.

Similar threads

  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
1
Views
7K
  • Programming and Computer Science
Replies
3
Views
4K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
25
Views
3K
  • Programming and Computer Science
Replies
11
Views
2K
  • Programming and Computer Science
Replies
9
Views
2K
  • Programming and Computer Science
Replies
3
Views
3K
  • Programming and Computer Science
Replies
1
Views
3K
Back
Top