So, have a Basic Example of JAVA Program :

We need two software to generate a Java Program->

Here are the few steps to the Compile and Run Java program:

Step 1) Go to the Start menu and Open notepad by selecting Programs > Accessories > Notepad.

Step 2) Make a code for the first basic program.

Write your First Basic Java Program

Step 3) Now, save the file as Basicprogram.java and make sure to save the file in the working folder C:\workspace

Step 4) Now, go and open the command prompt. 

              Go to Directory path C:\workspace

 Then, compile the above code using the command,

Write your First Basic Java Program

Step 5) If you look in your working folder, you can see that a file named FirstProgram.class has been created.

Step 6) Now, execute the code and enter the java command, followed by the class name.
               So, the expected output should be the ‘First Program.’

Note:   As we say, Java is case sensitive Programming language. 

So, all the code, commands, and file names should are used in the consistent casing.

Let’s have an example on case sensitive:

int demo=1;
int DEMO=1;

*These are completely different variables.

 Step 7) Now, copy the code and paste the same code in IDE like we say Eclipse the compiling and execution is done with the click of a button.

Write your First Basic Java Program

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.