What is Java?

By | September 29, 2021
What is Java

Java is widely used Object Oriented Programming Language, that means it is based on the concepts of “objects”, that are basic runtime entities.

It is high in demand because it is an open-source language and hence, readily available and is flexible and versatile in nature.

Hardware and Software Requirement

It is supported across multiple operating systems such as Sun Solaris 9, RedHat Enterprise Linux3.0, Windows Server 2003, Windows Vista and Windows XP Pro, macOS.

A text editor like notepad is required for writing programs in Java that can be later compiled on the terminal. A number of IDEs are also available for developing java code. These IDEs allow the users to write, compile and execute Java programs from a single interface.

The list of some of the popular IDEs.

  • BlueJ
  • Codenvy
  • DrJava
  • Eclipse
  • Greenfoot
  • IntelliJ IDEA
  • JCreator
  • (Oracle) JDeveloper
  • jGRASP
  • MyEclipse
  • NetBeans
  • RAD for WebSphere Software (Rational Application Developer)
  • Xcode

Saving the code: The file must be saved with the same name as that of the class having the main( ) method with .java extension to its name.

Compiling the code: To compile the code in the terminal the following commands must be executed.

$ java [fileName].java
$ java [fileName]

Java Environment

Java environment comprises of hundreds of classes and methods and several development tools. The Java Standard Library also called as the Application Programming Interface(API) includes the classes and methods and JDK includes the development tools.

Java Development Kit

JDK has a collection of tools that are used for developing and running Java programs.

The kit includes:

Tools Description
appletviewer: for java applets Enables us to run Java applets
javac: for Java compiler Translates Java source code to bytecode file that Interpreter can understand.
java: for Java interpreter Runs applications and applets by interpreting bytecode files.
javap: for disassembler Enables us to convert bytecode file into program description
javah: for C header files Produces header files for the use with native methods
javadoc: for creating HTML documents Creates HTML format documentation from Java source code files.
jdb: java debugger Helps to find errors in the program.

The way these tools are applied to build and run applications programs are illustrated below:

Fig: Process of building and running Java applications programs

Steps involved in the process are summarized as:

  • A Java source code is created in a text editor or an IDE.
  • The source code is then compiled using Java compiler javac and executed using Java interpreter java.
  • If there are any errors in the source code they are debugged by Java debugger jdb.
  • The compiled Java program is converted into source code with the help of javap.

Application Programming Interface

Collection of prewritten classes, packages and interface, with their respective fields, methods and constructors are grouped and included in the Java Standard Library (API) that serves as a software program interface facilitating interaction.

Some most commonly used packages are listed below:

  • Language Support Package: Collection of classes and methods required for implementing basic features of java.
  • Utilities Package: Collection of classes to provide utility functions such as date and time functions, collections framework.
  • Input/Output Package: Collection of classes required for input/output manipulation.
  • Networking Package: Collection of classes for communicating with other computers via the Internet.
  • AWT Package (Abstract Window Tool Kit package): It contains classes that platform-independent GUI.
  • Applet Package: It includes a set class that allows us to create Java applets.

Java Runtime Environment(JRE)

The JRE facilitates the execution of programs developed in Java.

It comprises of:

  • Java Virtual Machine(JVM): This interprets the intermediate java bytecode and generates output.
  • Runtime class libraries: These are set of core class libraries that are required for the execution of Java programs.
  • User interface toolkit: Toolkits that support varied input methods for the users to interact with the application program. For example, AWT and Swing.
  • Deployment technologies: JRE comprises of following key deployment technologies:
  • plug-in: Enables the execution of a Java applet on the browser.
  • Web Start: Enables remote-deployment of an application.

People are also reading:

Leave a Reply

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