Java Tutorial

Our Core Java programming tutorial is designed for students and working professionals. Java is an object-oriented, class-based, concurrent, secured and general-purpose computer programming language. It is a widely used robust technology.

What is Java?

Java is a programming language and a platform. Java is a high-level, robust, object-oriented and secure programming language.

Java was developed by Sun Microsystems (which is now a subsidiary of Oracle) in the year 1995. James Gosling is known as the father of Java. Before Java, its name was Oak. Since Oak was already a registered company, so James Gosling and his team changed the name from Oak to Java.

Platform: Any hardware or software environment in which a program runs is known as a platform. Since Java has a runtime environment (JRE) and API, it is called a platform.

Java Example

Let’s have a quick look at the Java programming example. A detailed description of the Hello World! example is available on the next page.

  1. public class Main{  
  2.     public static void main(String args[]){  
  3.      System.out.println(“Hello, World!”);  
  4.     }  
  5. }  
  1. Getting Started

    Before diving into coding, we will need to set up your development environment. Java development typically requires the Java Development Kit (JDK), which includes the Java Compiler and other essential tools. You can download the JDK from the official Oracle website and follow the installation instructions for your operating system.

    Once we have the JDK installed, you can use a text editor or an Integrated Development Environment (IDE) like IntelliJ IDEA, Eclipse, or NetBeans to write and run your Java code. IDEs provide features such as code completion, debugging, and project management, making them invaluable tools for developers.

    Application

    According to Sun Microsystems, 3 billion devices run Java. There are various devices where Java is currently used. Some of them are as follows:

    1. Desktop Applications such as Acrobat Reader, media player, antivirus, etc.
    2. Web Applications such as irctc.co.in, tpointtech.com, etc.
    3. Enterprise Applications such as banking applications.
    4. Mobile
    5. Embedded System
    6. Smart Card
    7. Robotics
    8. Games, etc.

    Types of Java Applications

    There are the following 4-types of applications that can be created using Java programming:

    1) Standalone Application

    Standalone applications are also known as desktop applications or window-based applications. These are traditional software that we need to install on every machine. Examples of standalone applications are Media players, antivirus, etc. AWT and Swing are used in Java for creating standalone applications.

    2) Web Application

    An application that runs on the server side and creates a dynamic page is called a web application. Currently, Servlet, JSP, Struts, Spring, Hibernate, JSF etc. technologies are used for creating web applications in Java.

    3) Enterprise Application

    An application that is distributed in nature, such as banking applications, etc. is called an enterprise application. It has advantages like high-level security, load balancing, and clustering. In Java, EJB is used for creating enterprise applications.

    4) Mobile Application

    An application that is created for mobile devices is called a mobile application. Currently, Android and Java ME are used for creating mobile applications.

    Java Platforms / Editions

    There are four platforms or editions of Java:

    1) Java SE (Java Standard Edition)

    It is a Java programming platform. It includes Java programming APIs such as java.lang, java.io, java.net, java.util, java.sql, java.math etc. It includes core topics like OOPs, String, Regex, Exception, Inner classes, Multithreading, I/O Stream, Networking, AWT, Swing, Reflection, Collection, etc.

    2) Java EE (Java Enterprise Edition)

    It is an enterprise platform that is mainly used to develop web and enterprise applications. It is built on top of the Java SE platform. It includes topics like Servlet, JSP, Web Services, EJB, JPA, etc.

    3) Java ME (Java Micro Edition)

    It is a micro platform that is dedicated to mobile applications.

    4) JavaFX

    It is used to develop rich Internet applications. It uses a lightweight user interface API.

History of Java

The history of Java is indeed fascinating. Originally designed for interactive television, Java’s journey began with the Green Team, a group within Sun Microsystems led by James Gosling. Their goal was to create a programming language for digital devices like set-top boxes and televisions. However, Java’s capabilities surpassed the needs of the digital cable television industry at the time. Instead, it found its niche in internet programming, offering a solution that was ahead of its time.

Java’s principles, including simplicity, robustness, portability, platform independence, security, high performance, multithreading, architecture neutrality, object orientation, interpretation, and dynamism, laid the foundation for its development. These principles ensured that Java was not only versatile but also adaptable to a wide range of applications.

James Gosling, often referred to as the father of Java, spearheaded the project in the early 1990s. Alongside his team, known as the Green Team, Gosling worked to refine and develop Java into the language we know today. Their efforts culminated in the release of Java in 1995. Netscape later incorporated Java technology into its browser, further propelling its popularity and solidifying its position as a key player in the world of programming languages. From its humble beginnings in digital television to its widespread use on the internet and beyond, Java has continued to evolve, remaining true to its core principles while adapting to the changing needs of the technological landscape.