In this post, I will introduce you to the Java programming language. By the end of this post you will know:-

  1. A brief history of Java.
Photo by Ilya Pavlov on Unsplash

What is Java?

To put in simple words, Java is a general-purpose programming language which is widely used to develop standalone as well as distributed applications ,which run on multiple servers and clients in a network. Java is a popular choice for development of mobile applications, web applications, desktop applications, embedded systems etc.

Brief History of Java

Java was developed by a team led by James Gosling at Sun Microsystem. The first version of Java (JDK 1.0) was released in the year 1996. Subsequent releases have added new features and libraries to the language making it easier to use. Sun Microsystem was acquired by Oracle in the year 2010, and since then Java has been managed by Oracle. The latest version of Java is JDK 14 which was released on March, 17th 2020.

Platforms of Java

The Java programming language has four platforms which are intended for different uses. All four platforms are listed below and described in brief.

  1. Java Platform, Standard Edition (Java SE): It provides the basic functionality of Java language and is mostly used to build small applications. Java SE can be used to develop standalone applications. The APIs of Java SE define the basic data types as well as objects of the language. It also provides APIs for networking, graphical user interface, security etc.

Features of Java

Features of Java

So what makes Java one of the most popular programming languages? We will explore this question now. The most compelling features of Java are discussed below in brief.

  1. Simple: Java is a simple language as it has eliminated all confusing and recondite concepts such as pointers and multiple inheritance. The syntax and the structure of program is similar to c++ and easy to undestand.

This is just a succinct summary of the Java features. There are many more features which add to the value and popularity of the language viz. multithreading, portability, high performance et cetera.

Setting Up Java

Now, let’s see how to set up Java on your system. First of all you need to download the software from the oracle website for free. It will takes just two clicks from the main page of oracle to the J2SE downloads page . Get the latest non-beta version posted. The SDK includes everything you need to compile and run Java.

However, the SDK does not include the API documentation, and you need that! So don’t forget to download the J2SE API documentation.

Now you need a text editor. Feel free to use the editor of your choice, be it Notepad++, Wordpad or any other editor.

Once you’ve downloaded and unpacked the zipped folder, you need to add an entry to your PATH environment variable that points to the bin directory inside the main Java directory so that when you type: % javac at the command-line, your terminal will know how to find the javac compiler.

The Working of Java

Step 1: Using your favourite text editor write the source code of your program. I am just showing a small sample to illustrate the process.

//Your First Program

public class SampleProgram {
public static void main(String[] args) {
System.out.println("My first program!");
}
}

Since, I have named the class SampleProgram so this file must be saved as SampleProgram.java.

Step 2: Now you need to compile the source code by running the following command:-

javac SampleProgram.java.

This will create a second file named SampleProgram.class.

This class file contains bytecode for the java source code.

Step 3: Run the program by starting the Java Virtual Machine (JVM) with the SampleProgram file. Use the following command to run the file.

java SampleProgram

The JVM translates the bytecode into something the underlying platform
understands, and runs your program .

Yipee! You just ran your first Java program. In the next post, I will delineate the features of Java language. Till then, keep playing around with your first program.

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Coding Guidelines in Flutter

Web development

How to Install Oracle Database 12c Release 2 in Linux 7

Compare gRPC-Web with grpc-gateway

How to Learn Tekla Structure Design Software?

A Journey Through Blameless from Incident to Success

What is Filebase and How do you use it?

Bonny: Extending Kubernetes with Elixir — Part 2

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mukund

Mukund

More from Medium

Java Strings

Inheritance in Java

JAVA Date & Time

Java Naming Conventions