Easy Tutorial
❮ Number Acos Java String Indexof ❯

Introduction to Java

Java is a general-purpose, object-oriented programming language and computing platform first released by Sun Microsystems in May 1995. It was developed by James Gosling and his team. After Sun Microsystems was acquired by Oracle Corporation, Java became an Oracle product.

Java is divided into three editions:

In June 2005, at the JavaOne conference, Sun Microsystems announced the release of Java SE 6. By this time, the various editions of Java had been renamed to remove the "2": J2EE became Java EE, J2SE became Java SE, and J2ME became Java ME.


Key Features

-

Java is Simple:

Java's syntax is similar to C and C++, making it easy for most programmers to learn and use. Java eliminates difficult-to-understand features like operator overloading, multiple inheritance, and automatic type casting found in C++. Instead of pointers, Java uses references and includes automatic memory management, relieving programmers from manual memory management.

-

Java is Object-Oriented:

Java supports features like classes, interfaces, and inheritance. It only supports single inheritance between classes but allows multiple inheritance between interfaces. Java also supports the implementation mechanism between classes and interfaces using the 'implements' keyword. Unlike C++, Java fully supports dynamic binding, making it a purely object-oriented language.

-

Java is Distributed:

Java supports the development of Internet applications and provides a network API (java.net) that includes classes for network programming, such as URL, URLConnection, Socket, and ServerSocket. Java's Remote Method Invocation (RMI) mechanism is also a key tool for developing distributed applications.

-

Java is Robust:

Java's strong type system, exception handling, and automatic garbage collection are key to its robustness. The decision to omit pointers was wise, and Java's security mechanisms enhance its robustness.

-

Java is Secure:

Java is often used in network environments and provides security features to prevent malicious code attacks. It includes a security mechanism for downloaded classes (ClassLoader), bytecode verification, and a security manager to set up security guards.

-

Java is Architecture-Neutral:

Java programs are compiled into architecture-neutral bytecode, which can run on any system that implements the Java platform. This approach is ideal for heterogeneous network environments and software distribution.

-

Java is Portable:

Java's portability is due to its architecture-neutral design and strict specification of data type lengths. The Java system itself is highly portable, with the Java compiler implemented in Java and the runtime environment in ANSI C.

-

Java is Interpreted:

Java programs are compiled into bytecode and then interpreted by the Java interpreter at runtime. Classes required during execution are loaded into the runtime environment during the linking phase.

-

Java is High-Performance:

Compared to interpreted scripting languages, Java offers high performance. With the development of Just-In-Time (JIT) compilation technology, Java's performance has approached that of C++.

-

Java is Multithreaded: In Java, a thread is a special object that must be created by the Thread class or its subclasses. There are typically two ways to create a thread: one is to use a constructor of the form Thread(Runnable) to wrap an object that implements the Runnable interface into a thread; the other is to derive a subclass from the Thread class and override the run method, where an object created by this subclass is a thread. It is worth noting that the Thread class itself has implemented the Runnable interface, so every thread has its run method, which contains the code that the thread is intended to execute. The activity of a thread is controlled by a set of methods. Java supports the concurrent execution of multiple threads and provides synchronization mechanisms (with the keyword synchronized) between threads.

Java is Dynamic:

One of the design goals of Java is to adapt to dynamically changing environments. Java programs can dynamically load the classes they need into the runtime environment, and classes can also be loaded over the network, which is beneficial for software upgrades. Additionally, Java classes have a runtime representation and can perform runtime type checks.


Development History


Java Development Tools

Java requires at least 1GB of system memory. Other tools include:

After installing the above tools, we can output the first Java program "Hello World!"

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello World");
    }
}

In the next section, we will introduce how to configure the Java development environment.

❮ Number Acos Java String Indexof ❯