Java is an object-oriented programming language that, while fundamentally based on the concept of classes, remains pragmatic. Therefore, Java has built-in data types that are stored on the stack. Java also closely resembles C syntax. Regarding inheritance, Java doesn't offer much that is new compared to C++.
Java is pragmatically object-oriented.
Overall, Java is a fully-fledged programming language that offers everything necessary for developing powerful applications. The included libraries are more than comprehensive. Its execution speed is on par with C code.
More interesting is what was omitted in Java. The most noticeable change is probably the absence of multiple inheritance. As practical as it would be, it doesn't fit the concept of a simple implementation. Interfaces offer a perfectly adequate replacement for the vast majority of purposes. Only in rare cases would the code be simpler if multiple inheritance were possible.
Heap management by the application was also omitted. Java uses a garbage collector for this, which removes unused elements from the heap and runs as a background process. Of course, there are conceivable cases where this process cannot keep up with its workload. Its activity can also affect the timing behavior of a Java application. On the other hand, it avoids many problems that arise in C++ due to memory being released at inopportune times. Every C++ programmer has probably experienced this. However, in cases where a large number of objects are created and discarded in a very short time, it is advisable in Java to consider object reuse.
A common complaint is the lack of operator overloading. Clearly, this is purely for simplification of syntax ( syntactic sugar ). As a mathematician, I would occasionally prefer operators to functional notation. But it's not essential. Introducing automatic type conversions can lead to disaster.
Initially, Java was designed for execution in a restricted environment (sandbox). This was necessary because, at the time, the applet—a program running in the browser—was central. Unfortunately, this functionality was abandoned in browsers in favor of JavaScript (AJAX), which is now natively supported by all browsers and therefore monitored by the browser vendors themselves. After the sale of Java to Oracle and the introduction of Microsoft's competing Java, distrust in Java became too great. Now, it's practically impossible to run applets in browsers. Java applications are now loaded and executed locally on the computer, or directly on the server.
None of the major operating systems offer security.
It's important to remember that none of the widely used operating systems offer anything comparable to sandboxes. While it's possible to protect data areas and access to the computer since Windows NT, in practice, any program can still break the system. Furthermore, very few users actually protect their data. Unix variants effectively protect the system and the user from each other; however, any program can establish external connections over the network and read and write all the data of the user who launched it. At the time, only Java offered a truly meaningful and automatic restriction of a running program to assigned directories and shared resources.
There are now open-source alternatives to Oracle's Java Runtime. This offers at least some protection against vulnerabilities inherent in Java itself.
This topic was hotly debated. Indeed, the first versions of Java were slow and set computers back about five years (a factor of eight). Furthermore, there were bugs and other shortcomings.
With the release of Java version 1.1.x and the completion of the first stable JIT (just-in-time) compilers, the situation changed. These compilers translate the bytecode into machine code upon loading, thereby accelerating program execution. Speed is no longer an issue for me. Comparisons show that Java can compete with C. The widely used scripting language Python, at least, is currently still about ten times slower.
Java is fast enough for all normal applications.
One of Sun's dreams when designing Java was to run it on small, moderately equipped computers. These computers wouldn't install their applications locally, but would instead load the necessary classes from the network as needed. Essentially, it's an advanced version of the old terminals. Through the network, these terminals would still have access to all the resources of the network.
The advantage, of course, would be that these applications only need to be maintained centrally. Indeed, it's undeniable that maintaining and installing applications on each individual workstation is a costly undertaking. The idea, therefore, is to reduce these costs ( total cost of ownership ) by acquiring standardized and inexpensive Java machines, with the actual administration handled centrally. The computer is plugged into the network and immediately functions as a fully integrated part of it.
Java makes it possible to create the perfect network computer.
Unfortunately, this dream will not become reality, as it contradicts market realities. Instead, there is a growing number of small systems running a special version of Java. This even includes smartphones.
Android applications are developed entirely in Java.
The idea that Java can be a good replacement for previously used scripts on the server is gaining increasing acceptance. Previously, when a user made a request, the server would execute a small program (script) written in a command-line language or a simple language like Perl. However, Java, with its network capabilities and extensive language features, is ideally suited to replace these languages. If the server itself runs in Java, it can even dynamically load individual classes to respond to requests (so-called servlets).
Unfortunately, Java is being used less and less as a programming language. The major exceptions are, of course, Android apps, and for specialists, web programming for servers. But on the desktop, there's little activity. The reason is a mistrust, spread particularly by Linux power users. Given the Java proponents Microsoft and Oracle, this is understandable. Microsoft has now even abandoned its Java version in favor of C#.
I want to compare Java in an enhancement of this course to more modern languages like Rust and Go. In my oppinion, Java still has to offer a lot more than appears at first sight. You get a complete programming environment and net resources with Java. You lose the ability to compile native executables. Java, however, has the same speed as C for general programming due to his Just-in-Time-Compiler. But you need to install the Java Runtime Environment.
In my personal opinion, Java is still very well suited for creating platform-independent and powerful applications. However, as long as academia remains resistant, we will see fewer and fewer Java applications, apart from Android apps.