Introduction to Java

 We have listed down the links to tutorials covering the basics of Java programming in this guide.

Table Of Contents

1. What is Java Programming Language
2. History of Java
3. Features of Java
4. Automatic Garbage Collection
5. Java Hello World Program

What is Java Programming Language?

In addition to being concurrent, class-based, and object-oriented, Java has few implementation dependencies and is designed for general purposes.
As an example, a Java program can be written and compiled on UNIX and then run on UNIX, Windows, or Macintosh computers.

History of Java

Sun Microsystems’ Java platform was launched in 1995 as part of Java by James Gosling (now of Oracle Corporation).
With the January 27, 2010 acquisition of Sun Microsystems, Oracle Corporation now owns the official Java SE platform implementation.
The original Java implementation by Sun is used in this implementation.

There are two distributions of the Oracle implementation:

  1. A Java Runtime Environment (JRE) is a package containing the Java SE platform parts that are necessary for running Java programs.
  2. There are many development tools included in the Java Development Kit (JDK), including an executable, Javadoc, JavadocX, Jar, and a debugger.

Features of Java:

Object Oriented

In Java, everything is an Object. Java can be easily extended since it is based on the Object model.

Platform Independent

Unlike many other programming languages including C and C++, when Java is compiled, it is not compiled into platform specific machine, rather into platform-independent byte code. This byte code is distributed over the web and interpreted by the Virtual Machine (JVM) on whichever platform it is being run on.

Simple and Secure

Java is designed to be easy to learn. If you understand the basic concept of OOP Java, it would be easy to master.

With Java’s secure feature it enables to develop virus-free, tamper-free systems. Authentication techniques are based on public-key encryption.

Architecture-neutral

Java compiler generates an architecture-neutral object file format, which makes the compiled code executable on many processors, with the presence of Java runtime system.

Portable

Being architecture-neutral and having no implementation dependent aspects of the specification makes Java portable. The compiler in Java is written in ANSI C with a clean portability boundary, which is a POSIX subset.

Robust

Java makes an effort to eliminate error-prone situations by emphasizing mainly on compile time error checking and runtime checking.

Multithreaded

With Java’s multithreaded feature it is possible to write programs that can perform many tasks simultaneously. This design feature allows the developers to construct interactive applications that can run smoothly.

Interpreted

Java byte code is translated on the fly to native machine instructions and is not stored anywhere. The development process is more rapid and analytical since the linking is an incremental and light-weight process.

High Performance

With the use of Just-In-Time compilers, Java enables high performance.

Dynamic

Java is considered to be more dynamic than C or C++ since it is designed to adapt to an evolving environment. Java programs can carry an extensive amount of run-time information that can be used to verify and resolve accesses to objects at run-time.

Automatic Garbage Collection

Memory is managed automatically by a garbage collector in Java during the lifecycle of an object.Java runstime recovers memory once no longer needed objects are
created by the programmer. Unreachable memory becomes eligible for automatic garbage collection once there are no more references to the object.

Something same to a memory leak can additionally nevertheless appear if a programmer’s code holds a reference to an object that is no longer needed, typically when
objects that are no longer wished are saved in containers that are although in use.

Garbage series might also occur at any time. Ideally, it will appear when a software is idle. It is assured to be brought on if there is inadequate free reminiscence on the heap to allocate a nnew object; this can purpose a software to stall momentarily. Explicit reminiscence administration is now not feasible in Java.

Java Hello World Program

Application.java
public class Application
{
public static void main(String[] args)
{
System.out.println(“Hello World!”); // Prints Hello World! to the console.
}
}

1.Java supply archives should be named after the public type they contain, appending the suffix .java, for example, Application.java.
2.Java grant archives have to be named after the public kind they contain, appending the suffix .java, for example, Application.java.
3.The Java supply file might also solely incorporate one public class, however it can incorporate a couple of instructions with different than public get entry
to and any quantity of public internal classes.
4.When the supply file consists of more than one classes, make one type ‘public’ and title the supply file with that public type name.

Java.txt
Displaying Java.txt.

Leave a Comment

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