class Main { public static void main(String[] args) { System.out.println("Compiler ONE"); } }

Introduction to Java


Introduction

Java is an Object-Oriented Programming Language developed by James Gosling at Sun Microsystems (acquired by the Oracle Corporation, 2010), in 1995.

Java is a platform independent language. Java programs do not access the operating system directly. Java Virtual Machine (JVM) is used as an abstraction between the OS and the Java programs. This makes Java programs highly portable; a Java program can run on all supported platforms (e.g., Windows or Linux) without any modification.

The main purpose for developing java language is to control consumer electronics devices.
On May 23, 1995 the Java environment was announced by Sun Microsystems.


Why named as 'Java' and what about logo

Java initially named as ‘Greentalk’ by James Gosling with the extension as .gt. Later it was called as Oak after an oak tree that stood outside Gosling's office and later renamed as Java because 'Oak' was a name already trademarked and used by another company.

The name 'Java' is taken from a list of random words and is based on the famous coffee bean of Java Island which was said to be consumed in large quantities by the language's creators. Java is not an acronym for "Just Another Vague Acronym."

That’s why the logo of Java is a cup of hot coffee.


Java Editions

Basically, Java can be classified into 3 categories:

Java SE (Java Standard Edition): Java SE (formerly J2SE) is a collection of Java API's that is used for developing desktop applications including applets, swings. It contains core part of Java.

Java EE (Java Enterprise Edition): Java EE (formerly J2EE and now known as Jakarta EE) is a collection of Java API's that is used for developing applications which run on servers i.e., web applications like websites. It includes jsp, servlets, beans etc.

Java ME (Java Micro Edition): Java ME (formerly J2ME) is a collection of Java APIs that is used for developing applications for small devices like mobile phones, PDAs. For example, mobile games, mobile applications etc.


Features of Java

• Simple and Familiar: Java language is easy to learn. Java code is easy to read and write. In terms of program creation, Java is quiet similar to C/C++. It removes the drawbacks and complexities of C/C++ like pointers and multiple inheritances etc. to keep the language simple and secure.

• Object Oriented: Java is an object-oriented programming language. It has all OOP features such as abstraction, encapsulation, inheritance and polymorphism.

• Compiled and Interpreted: Typically, a programming language is either compiled or interpreted (for example, C is a complied language and Python is an interpreted language). Java is both compiled and interpreted.

• Platform-Independent: The slogan of Java is “Write once, run anywhere” and this is achieved by introducing the concept of Platform independence. Platform independence is one of the major advantages of java language. Programs which are developed in java language are platform neutral i.e. they may create in one type of OS (Windows) and may run in any other kind of OS (Linux or Mac OS).
Java uses the concept of byte code which actually makes java, a platform independent language.
Java is the first language which is platform independent.
Other languages such as C, C++ etc. generates an executable file (machine code) according to the operating system and thus this exe file is operating system dependent (platform dependent) i.e. executable file which is generated in window OS can run only in window OS’s.
Java does not generate machine code directly, instead of it generates a scarp code (called byte code) from source code by using java complier. This byte code is platform independent.
Then, java virtual machine (JVM) generates the machine code according to the machine from the byte code.

• Robust and Secure: Java is a most robust language which provides many features to make Java code reliable. Java itself manage the memory deallocation which helps the programmers virtually free from all memory management problems. It also fully supports the concept of exception handling, which detect extreme exceptions and reduces the threat of crashing the system.
Security is one of the most important feature of Java. It eliminates the various vulnerable features which weaken the security. The absence of user-defined pointers in Java to ensures that programs cannot get right of entry to memory location without proper approval is one of the example of it.

• Multi-threading: Java support multithreaded programming. We can build applications with many concurrent threads of activity, resulting in highly interactive and responsive applications.

• Distributed: Java is distributed in nature as we can build and distribute applications on networks which can contribute both data and programs. Java applications are also capable of accessing remote objects over Internet.

• Dynamic and Extensible: Java is able to extend its features by linking new classes and libraries dynamically. It also supports code written in other languages (C, C++ etc.), known as native methods.


Some widely known products and applications that use Java.

Android Apps: Android apps are developed in Java language. All of the Android apps, the code written is basically Java. Even the latest Android-app maker Kotlin programming language is inspired by Java.

Software Development IDEs: Java is used to develop many IDEs that are helpful to development of the softwares. Some of the IDEs based on Java are Eclipse, IntelliJ IDEA, and NetBeans IDE etc.

Big Data technologies: Java gives you access to tons of tried-and-tested libraries, debuggers, and monitoring tools. Hadoop is written in Java. Scala, Kafka, and Spark use JVM.

Web Applications: Java is widely used in E-commerce and web application space. Java Servlet, JSP, and Struts based web applications are quite popular on various government projects. Many governments, healthcare, insurance, education, defense, and several other departments have their web application built in Java.

Scientific Applications: Java is wide used in scientific applications. Some of the main domains where Java is used are : Natural Language processing and AI.

J2ME Applications: J2ME i.e. Java Micro Edition is very popular and used in products like Blu-ray, Card-chip programming, Set-top boxes, etc.


Some drawbacks of Java.

• Java programs take much longer time to run compared to C/C++.
• Since Java Programs run on top of Java Virtual Machine, it consumes more memory.
• We don't have much control over the Garbage collection mechanism.
• Since memory and processing requirements higher, hardware cost increases.


Learning App

Learn Java Programming for free via our android app

Get it on google play

Free Java Tutorials

Explore our YouTube Channel to access most important basic tutorials on Java.

Explore  Channel