How to Write First Program in JAVA

by Kevin-O-Brien in Circuits > Software

3093 Views, 16 Favorites, 0 Comments

How to Write First Program in JAVA

java_logo.png

In order to start writing programs in Java, set up your work environment.

Any sort of Notepad-like program will suffice for programming in Java.

Make sure that you have the Java Software Development Kit installed. You will need this for compiling your program.

Lets Start Witting a Java Program

In Your Text Editor, Create a New File and Save It As "HelloWorld.java".

91968-5.jpg

Declare Your Class and Your Main Method. the Main Method Public Static Void Main(String[] Args) Is the Method That Will Be Executed When the Programming Is Running.

91968-6.jpg

Write the Line of Code That Will Print Out "Hello World."

7.jpg

Save Your File and Open Up Command Prompt or Terminal to Compile the Program.

8.jpg

Save Your File and Open Up Command Prompt or Terminal to Compile the Program.

9.jpg

Congratulations, You Have Made Your First Java Program!

010.jpg