What is Java Programming Language?

What is Java Programming Language?

What is Java Programming Language?

Java is a programming language developed by Sun Microsystems officially released in 1995.

Some of the factors that make Java favorite among developers are: –

1) Simple-it’s easy to write and read Java code.
2) Security-Java web applications can be accessed securely.
3) Portability-Java applications can run on any platform.
4) Object Oriented-Java is pure OPP. Objects created can be recycled and used anywhere in the application.
5) Robustness- Java programs are error free. Checks can be performed during run-time.
6) Java is Multithreaded-Several Threads can run concurrently without interfering with one another.
7) Fast Performance-Java bytecodes are highly optimized. Java virtual machine executes them very quickly.
8) Distributed-Java applications can run over the internet.
9) Independence-Java applications are not tied to any hardware or operating system.

Requirements for Running Java programs.

To execute a Java program, you need to have the following.
1. Download and Install JDK.
2. Download and Install Netbeans IDE.
Note: There are several types of Java Editors that you can use to write Java code but I prefer Netbeans which is much easier to use.

First Java Program Hello World.


Below is the outputWhat is Java Programming Language?

Understanding Hello World Program.

Lets look at the above code and define meaning of some of the keywords used.

package-its a namespace that is used to organize classes that are related.To use classes in a certain package you have to import the package.For example to use class hello.java in another package we will be required to import the class i.e

public-keyword that determines class accessibility.public means that the class is accessible to all other classes.

static-all methods with static keyword are declared as static methods.They save memory because JVM does not require to create object to call this method.

void– means that the method doesn’t return anything.

main-this is where the program starts.Its the only method that is called to start the program.

String[] args-these are command line  arguments that  i will discuss later.

System.out.println-this is the method that outputs something to the screen after JVM executes java code.

Running Hello World Program using Command Prompt

Write a simple program like one show below using notepad.

Running java program through command prompt

Save the file in your drive.

  • Open Command Prompt.
  • Open the drive where the file is stored.In my case i will enter E:
  • Open the folder i.e cd Java
  • Set JDK path i.e set path=C:Program FilesJavajdk1.8.0_111bin
  • Compile the class by invoking JVM i.e  javac Hello.java
  • Run program by entering this command java Hello.

How to set JDK Environment Variables in Windows 10

java programming


Next Topic: Data types and Variables in Java


About the Author: Eric K

Kenyan Developer and Blogger with Interests in Java,Javascript,Node.js, Wordpress, Android, PHP and Making Money Online. Solving world problems through programming is my passion. Hire me: Email : kawi3462@gmail.com