The main advantage of Java is that it can run on multiple platforms / computer operating systems , in accordance with the principle of write once, run anywhere . With this advantage the programmer simply writes a Java program and compiles (converted, from a human -understood language to a machine language / bytecode ) once and then the result can be run on multiple platforms without changes. This advantage allows a java -based program to work on the Linux operating system but run well on Microsoft Windows. Platforms supported to date are Microsoft Windows , Linux , Mac OS and
Sun Solaris . The reason is that each operating system uses its own program (which can be downloaded from a Java site) to interpret the bytecode .
- Complete Classroom Library
Java is known for its library equipment ( a group of programs included in java programming) that is very easy to use by programmers to develop their applications. The completeness of this library is coupled with the existence of a large Java community that is constantly creating new libraries to cover all application development needs.
- C ++ style
It has syntax like the C ++ programming language so it attracts many C ++ programmers to move to Java. Currently there are many Java users, most of them are C ++ programmers who have moved to Java. Universities in the United States are also beginning to move by teaching Java to new students because it is easier for students to understand and can be useful as well for those who are not majoring in computers.
- Garbage Collection
Automatically, it has the facility of setting memory usage so that programmers do not need to perform memory settings directly (as is the case in the widely used C ++ language).
- Write Once, Run Anywhere
There are still some things that are not compatible between one platform and another. For J2SE , for example SWT-AWT bridge which until now does not work on Mac OS X.
- Easy to Decompile
Decompilation is the process of turning from current code into source code. This is possible because Java-based code is a bytecode that stores many high-level language attributes, such as class names, methods, and data types. The same is true of the Microsoft .NET Platform . Thus, the algorithm used by the program will be more difficult to hide and easily hijacked/ reverse-engineered .
- Excessive Memory Consumption
Memory usage for Java -based programs is much greater than previous generation high -level languages such as C/ C ++ and Pascal (more specifically, Delphi and Object Pascal ). Usually this is not a problem for those who use the latest technology (because the trend of installed memory is getting cheaper), but a problem for those who still have to struggle with computer machines older than 4 years.