Java is a compiled and object-oriented, general-purpose programming language, first released in 1996 at Sun Microsystems and later acquired by Oracle. James Gosling created it, by accident, a few years earlier, and it was first named Greentalk and then Oak. C++ and C influence Java, and all code is written inside classes.
- Code Execution
Applications written in Java are platform-independent. The code is written and saved as a .java-file. The Java compiler translates this code into executable java-byte code and saves it as .class-files. The Java Virtual Machine can execute this code. The advantage is that code must only be written once and can still be run on any platform. The disadvantage is that Java is slower to start than other comparable programming languages but faster to run.
Java uses class-based inheritance. All properties are part of the class and inherited by every instance of that class. Furthermore, multiple inheritances are supported, i.e. a class can derive properties from multiple classes.
Java supports multi-threading so that developers can work with multiple threads that maintain parallel concurrency at the price of high memory and processing requirements.
Java is strongly and statically typed. Types of variables and objects must be explicitly specified. Once a variable has been declared as a type, this variable’s type can’t be changed later, and it won’t be automatically converted into another type. However, implicit (automatic) conversions are run on primitive data types, e.g. an int type can be converted into a float type. Errors can be detected at compile-time instead of at runtime (static), and the code is rejected before it runs. This makes Java robust. Additionally, Java offers memory management, an automatic garbage collector, and exception handling.
One special feature of Java is that there are four versions:
- Java Standard Edition (Java SE)
Lets users develop and deploy Java applications on desktops and servers.
- Java Enterprise Edition (Java EE)
Offers an enterprise software platform for developing server-side Java applications and allows the implementation of enterprise-class service-oriented architecture and Web 2.0 applications.
- Java Micro Edition (Java ME)
Focuses on the Internet of Things and the deployment of portable code for embedded and mobile devices.
- Java Card
Targets embedded devices and allows Java-based applications to be run on smart cards, e.g. ATM cards.
Developers use Java for various purposes:
- Enterprise software
- Android applications
- Web applications (mostly server-side)
- Big Data analytics
- Scientific computing applications
- Operating System components,
- Embedded systems + Internet of Things
- Social media platforms like Twitter
Google’s Android operating systems use Java APIs. Worldwide, more than 3 billion devices use Java.
Scott Böning, Code Institute Student