In this article History of Java we give the information about the Java language was created in 1991 by James Gosling and his team at Sun Microsystems. It is used to develop advanced and secure applications, websites, mobile applications and desktop applications etc.

Introduction to Java:-

Java is a programming language used for software development. It is used to develop advanced and secure applications, websites, mobile applications and desktop applications etc. This programming language is of high level which uses the principles of Object-Oriented Programming. This makes it a language that can be used for a wide variety of tasks.

Software developed by Java requires a Java Virtual Machine to operate. Java virtual machine is a software that systematically interprets Java code so that it can run on all platforms without any problem.

In Java, source code is compiled into byte code, whereas in other languages, source code is compiled into machine code.

History of Java:

The Java language was created in 1991 by James Gosling and his team at Sun Microsystems. This team is also called Green Team which included James Gosling, Mike Sheridan, and Patrick Naughton. All of them work in Sun Microsystem.

Sun Microsystem used to make software for its clients, but they had to do different coding to run the same software on different machines, in view of which they thought of creating Java language. Which is platform independent and can be easily run on any platform.

Java language was developed as a project to create a language for digital devices like set-top boxes, televisions.

Nowadays, Java is used for making internet programming, mobile devices, games etc.

Java is the most popular and widely used programming language in the world today. Java is a portable, secure and robust, programming language.

The Java language was developed as a project in June 1991 by a team working at Sun Microsystem called Green Team.

The real name of Java was Oak. Oak is a symbol of strength and it was also a national tree in many countries like U.S.A., France, Germany, Romania.

At that time, a company with the name Oak was already registered, so there was discussion about changing its name, but it was not possible to decide on a name, then one day when the Oak team was sitting where they were drinking coffee, there was Indonation coffee which was indonescence. Coffee was made from a substance called java, hence it was named java.

In 1995, its name was changed from Oak to Java. The first version of Java (Java 1.0) was publicly released in 1995.

Java Version History:-

Java Versions Release Date
JDK Alpha and Beta 1995
JDK 1.0 23rd Jan 1996
JDK 1.1 19th Feb 1997
J2SE 1.2 8th Dec 1998
J2SE 1.3 8th May 2000
J2SE 1.4 6th Feb 2002
J2SE 5.0 30th Sep 2004
Java SE 6 11th Dec 2006
Java SE 7 28th July 2011
Java SE 8 18th Mar 2014
Java SE 9 21st Sep 2017
Java SE 10 20th Mar 2018
JAVA SE 11 25th Sep 2018
JAVA SE 12 19th Mar 2019
JAVA SE 13 17th Sep 2019
JAVA SE 14 17th Mar 2020
JAVA SE 15 15th Sep 2020
JAVA SE 16 16th March 2021
JAVA SE 17 September 2021
JAVA SE 18 March 2022
JAVA SE 19 September 2022
JAVA SE 20 March 2023
JAVA SE 21 September 2023

Simple Program in java:

class Hello

{

public static void main(String []args)

{

System.out.println(“Have a nice Day!”);

}

}

Output:

Have a nice Day!

// public static void main(String []args)  – In detail Explanation 

Part Meaning
public This means the method is accessible from anywhere (even outside the class). JVM needs to access it, so it must be public.
static This means the method belongs to the class, not an object. So JVM can run it without creating an object of the class.
void This means the method does not return any value.
main This is the name of the method where the program starts. JVM looks for this name.
String[] args

This is an array of strings. It stores any command-line arguments you pass while running the program.

// System.out.println(…);   In details Explanation

System.out.println is used in Java to print a message or value to the console, followed by a new line.

Part Meaning
System A built-in class in the java.lang package.
out A static object of PrintStream class inside System. It represents standard output (the screen).
println(…) A method of PrintStream class that prints the message and then moves the cursor to a new line.
// Command line arguments
class Factorial
{
public static void main(String []args)
{
int no=Integer.parseInt(args[0]);
int fact =1;
for(int i=1;i<=no;i++)
fact=fact*i;
System.out.println(“The Factorial of “+no+” is “+fact);
}
}
OutPut:
D:\Java P>javac Factorial.java
D:\Java P>java Factorial
Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 0
        at Factorial.main(Factorial.java:6)
D:\Java P>java Factorial 4
The Factorial of 4 is 24
// int no=Integer.parseInt(args[0]);   – Explanation in Details 
“Take the first command-line argument (which is a string), convert it to an integer, and store it in the variable no.”
args [0] – Refers to the first value passed via the command line when running the Java program. This value is a String by default.
Integer.parseInt(…) – Converts the String to an integer (i.e., “5” becomes 5).
int no = … – Stores the result (converted integer) in an int variable called no.

// Addition of two numbers using Scanner Class

import java.util.Scanner;              // Imports the Scanner class.

public class AddTwoNumbers

{
public static void main(String[] args)

{
// Create Scanner object to read input

Scanner input = new Scanner(System.in);             // Creates a scanner object to read input from the keyboard.

// Ask user to enter first number

System.out.print(“Enter the first number: “);

int num1 = input.nextInt(); // Read first number

// Ask user to enter second number

System.out.print(“Enter the second number: “);

int num2 = input.nextInt(); // Read second number

// Calculate sum

int sum = num1 + num2;

// Display result

System.out.println(“The sum of ” + num1 + ” and ” + num2 + ” is: ” + sum);

// Close the scanner

input.close();

}

}

OutPut:

Enter the first number: 10
Enter the second number: 20
The sum of 10 and 20 is: 30

// Scanner input = new Scanner(System.in); — Explanation in Detail:

This line is used to create a Scanner object in Java that allows the program to read user input from the keyboard (console).

Part Meaning
Scanner This is a class in Java (from java.util package) used for input.
input This is the object name (you can name it anything).
new Scanner(…) This creates a new Scanner object.
System.in This is the standard input stream, which means keyboard input.

The Scanner object (input) can now use methods like:

  • nextInt() – to read an integer
  • nextDouble() – to read a decimal number
  • nextLine() – to read a full line
  • next() – to read a single word

Some More: 

POP- Introduction to Programming Using ‘C’

DS – Data structure Using C

OOP – Object Oriented Programming 

Java Programming

DBMS – Database Management System

RDBMS – Relational Database Management System

Join Now: Data Warehousing and Data Mining 

Leave a Reply

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