Table of Contents
In this tutorial, you’ll learn about the features of Java. What makes java popular in the world of programming.
Features of java
Java is a simple language
Java is easy to learn and its syntax is clear and concise. It is based on C++ (so it is easier for programmers who know C++). Java has removed many confusing and rarely-used features e.g. explicit pointers, operator overloading, etc. Java also takes care of memory management and it also provides an automatic garbage collector. This collects the unused objects automatically.
Java is a distributed language
It is distributed because it encourages users to create distributed applications. In Java, we can split a program into many parts and store these parts on different computers. A Java programmer sitting on a machine can access another program running on the other machine.
Java is a platform-independent language
The programs written in Java language, after compilation, are converted into an intermediate level language called the bytecode which is a part of the Java platform irrespective of the machine on which the programs run. This makes java highly portable as its bytecodes can be run on any machine by an interpreter called the Java Virtual Machine(JVM) and thus java provides ‘reusability of code’.
Java is an object-oriented programming language
OOP makes the complete program simpler by dividing it into a number of objects. The objects can be used as a bridge to have data flow from one function to another. We can easily modify data and function’s as per the requirements of the program.
Java programs can create applets
Applets are programs that run in web browsers.
Java does not require any preprocessor
It does not require the inclusion of header files for creating a Java application.
Java is a robust language
Java programs must be reliable because they are used in both consumer and mission-critical applications, ranging from Blu-ray players to navigation systems.
Java is a multithreaded language
Java can perform many tasks at once by defining multiple threads. For example, a program that manages a Graphical User Interface (GUI) while waiting for input from a network connection uses another thread to perform and wait’s instead of using the default GUI thread for both tasks. This keeps the GUI responsive.
Now, we are making our every first program in java, that too easy
HelloWorld Program in Java Programming
// A Java program to print "Hello World"
public class Hello {
public static void main(String args[])
{
System.out.println("Hello World");
}
}
Save the file with the name “Hello.java” in a folder. Please note that name of the file should be the same as the name given to public class.