Skip to main content

Introduction

What is Javaโ€‹

Java is one of the most widely used programming languages in the world.

Originally developed by Sun Microsystems in the 1990s for developing everything from web applications to mobile applications to batch applications, Java started out as a purely object-oriented language but has evolved into a multi-paradigm language that is highly adaptable to any situation. With a large community of developers and a support library, Java is ideal for developing almost any type of application.

Java was originally developed by James Gosling (who is known as the father of the Java programming language) at Sun Microsystems (now acquired by Oracle) and was released in 1995 as a core component of Sun's Java platform.

James Gosling (James Gosling), Mike Sheridan (Mike Sheridan) and Patrick Naughton (Patrick Naughton) launched the Java language project in June 1991. Java was originally designed for interactive television, but was too advanced for the digital cable industry at the time. The language was first called Oak after an oak tree outside James Gosling's (James Gosling's) office.

It was later renamed Green and eventually renamed from Java coffee (an Indonesian coffee) to Java.

Java SEโ€‹

Java SE (Java Platform Standard Edition) formerly known as J2SE, allows the development and deployment of Java applications for use on desktops, servers, embedded environments and real-time environments. Java SE contains classes to support Java Web services development and provides the foundation for Java EE provides the foundation for technologies such as Java language fundamentals, JDBC operations, I/O operations, network communications, and multi-threading.

Java EEโ€‹

Java EE (Java Platform Enterprise Edition) formerly known as J2EE. the Enterprise Edition helps develop and deploy server-side Java applications that are portable, robust, scalable and secure. models, management and communication APIs that can be used to implement enterprise-class Service Oriented Architecture (SOA) and Web 2.0 applications.

Java MEโ€‹

Java ME (Java Platform Micro Edition) formerly known as J2ME, also known as K-JAVA. Java ME provides a robust and flexible environment for applications running on mobile and embedded devices such as mobile phones, PDAs, TV set-top boxes and printers.

Java ME includes a flexible user interface, a robust security model, rich built-in networking protocols and the ability to dynamically download networked and offline applications. Applications based on the Java ME specification can be written once for many devices and can take advantage of the native capabilities of each device.

Features of Javaโ€‹

Simplicityโ€‹

Styled much like C and C++, Java is a purely object-oriented language that inherits the object-oriented technical core of the C++ language, but discards some of the shortcomings of C++, such as error-prone pointers and multiple inheritance, and also adds a rubbish collection mechanism to free up memory space that is not being used, solving the problem of managing memory space.

Object-orientedโ€‹

Java is an object-oriented language with good support for classes, objects, inheritance, encapsulation, polymorphism, interfaces, packages, etc. in objects. For the sake of simplicity, Java only supports single inheritance between classes, but multiple inheritance can be implemented using interfaces. Developing programs using the Java language requires object-oriented thinking in designing programs and writing code.

Platform Independenceโ€‹

Platform independence is demonstrated by the fact that Java is a "Write Once, Run any Where" language, so programs written in Java are highly portable, and this is ensured by the Java virtual machine mechanism. With the introduction of the virtual machine, the Java language does not need to be recompiled to run on different platforms.

Portabilityโ€‹

The data size of Java's basic data types is standardised and there is no concept of "implementation specific". So .jar files can be run on Windows, Mac OS and Linux systems without recompilation.

Multi-threadingโ€‹

The Java language is easy to implement, and it is a feature of the Java language that it must be created by the Thread class and its subclasses. Any thread has its own run() method, and the method to be executed is written inside the run() method. There are several ways to implement multithreading.

  • Implementing multithreading in user space
  • Multi-threading in kernel space
  • mixed implementation of threads in user and kernel space

High performanceโ€‹

The code is written, compiled to bytecode by the javac compiler, and then converted to machine code by the JVM's embedded interpreter, which is interpreted and executed, which is relatively inefficient. However, some JVM implementations such as the Hotspot JVM offer a JIT (Just in Time) dynamic compiler, which can compile hotspot code into machine code at runtime. With the development of JIT (Just in Time), Java is running faster and faster.

Robustnessโ€‹

Java's strong typing mechanism, exception handling and rubbish collection mechanisms are all important guarantees of Java's robustness. The discarding of pointers is a major step forward for Java. In addition, Java's exception mechanism is a great example of robustness.

Distributedโ€‹

The Java language supports the development of Internet applications, and among Java's basic application programming interfaces is the Network Application Programming Interface, which provides a library of classes for programming network applications, including URLs, URLConnection, Sockets, etc. Java's RIM mechanism is also an important tool for developing distributed applications.

Securityโ€‹

Java is often used in a networked environment and for this reason Java provides a security mechanism to prevent attacks by malicious code. In addition to the many security features of the Java language, Java has a security mechanism for classes downloaded over the network (class ClassLoader), such as allocating different namespaces to prevent replacing local classes of the same name, byte code checking, and providing a security management mechanism (class SecurityManager) to allow Java applications to set up security sentries.

Development environment for Javaโ€‹

JDKโ€‹

The JDK (Java Development Kit), known as the Java Development Kit or Java Development Tools, is an application development environment for writing Java Applet applets and applications. tools and Java's core class libraries (Java API).

JREโ€‹

The JRE (Java Runtime Environment) is a runtime environment, which is required to run Java programs, and is included in the JDK, so you can edit and run Java programs once it is installed. You do not need to install the JDK if you are running ordinary java programs, just the JRE.