Criticism of Java

Last updated

The Java programming language and Java software platform have been criticized for design choices including the implementation of generics, forced object-oriented programming, the handling of unsigned numbers, the implementation of floating-point arithmetic, and a history of security vulnerabilities in the primary Java VM implementation, HotSpot. Software written in Java, especially its early versions, has been criticized for its performance compared to software written in other programming languages. Developers have also remarked that differences in various Java implementations must be taken into account when writing complex Java programs that must work with all of them. [1]

Contents

Language syntax and semantics

Checked exceptions

Java introduced checked exceptions where a method must declare the checked exceptions it throws in the method signature. This can result in unnecessarily verbose boilerplate code. No major language has followed Java in implementing checked exceptions.

Generics

When generics were added to Java 5.0, there was already a large framework of classes (many of which were already deprecated), so generics were implemented using type erasure to allow for migration compatibility and re-use of these existing classes. This limited the features that could be provided, compared to other languages. [2] [3]

Because generics are implemented using type erasure the actual type of a template parameter E is unavailable at run time. Thus, the following operations are not possible in Java: [4]

publicclassMyClass<E>{publicstaticvoidmyMethod(Objectitem){if(iteminstanceofE){//Compiler error...}Eitem2=newE();//Compiler errorE[]iArray=newE[10];//Compiler error}}

Additionally, in 2016, the following example was found revealing Java to be unsound and in turn making JVMs which threw ClassCastExceptions or any other kind of runtime error technically non-conforming. [5] This was corrected in Java 10.

classNullless<T,U>{classConstrain<BextendsU>{}finalConstrain<?superT>constrain;finalUu;Nullless(Tt){u=coerce(t);constrain=getConstrain();}<BextendsU>Uupcast(Constrain<B>constrain,Bb){returnb;}Ucoerce(Tt){returnupcast(constrain,t);}Constrain<?superT>getConstrain(){returnconstrain;}publicstaticvoidmain(String[]args){Stringzero=newNullless<Integer,String>(0).u;}}

Noun-orientedness

By design, Java encourages programmers to think of a solution in terms of nouns (classes) interacting with each other, and to think of verbs (methods) as operations that can be performed on or by that noun. [6] Steve Yegge argues that this causes an unnecessary restriction on language expressiveness because a class can have multiple functions that operate on it, but a function is bound to a class and can never operate on multiple types. [7]

Many other multi-paradigm languages support functions as a top-level construct. When combined with other features such as function overloading (one verb, multiple nouns) and generic functions (one verb, a family of nouns with certain properties), the programmer can decide whether to solve a specific problem in terms of nouns or verbs. Java version 8 introduced some functional programming features.

Unsigned integer types

Java lacks native unsigned integer types. Unsigned data is often generated from programs written in C, and the lack of these types prevents direct data interchange between C and Java. Unsigned large numbers are also used in a number of numeric processing fields, including cryptography, which can make Java more inconvenient to use for these tasks. [8] Although it is possible to get around this problem using conversion code and larger data types, it makes using Java cumbersome for handling unsigned data. While a 32-bit signed integer may be used to hold a 16-bit unsigned value losslessly, and a 64-bit signed integer a 32-bit unsigned integer, there is no larger type to hold a 64-bit unsigned integer. In all cases, the memory consumed may double, and typically any logic relying on two's complement overflow must be rewritten. If abstracted, function calls become necessary for many operations which are native to some other languages. Alternatively, it is possible to use Java's signed integers to emulate unsigned integers of the same size, but this requires detailed knowledge of bitwise operations. [9] Some support for unsigned integer types was provided in JDK 8, but not for unsigned bytes and with no support in the Java language. [10]

Operator overloading

Java has been criticized for not supporting user-defined operators.[ citation needed ] Operator overloading improves readability, [11] so its absence can make Java code less readable, especially for classes representing mathematical objects, such as complex numbers and matrices. Java has only one non-numerical use of an operator: + and += for string concatenation. However, this is implemented by the compiler, which generates code to create StringBuilder instances. It is impossible to create user-defined operator overloads.

Compound value types

Java lacks compound value types, such as structs in C, bundles of data that are manipulated directly instead of indirectly via references. Value types can sometimes be faster and smaller than classes with references. [12] [13] [14] For example, Java's HashMap is implemented as an array of references to HashMap.Entry objects, [15] which in turn contain references to key and value objects. Looking something up requires inefficient double dereferencing. If Entry were a value type, the array could store key-value pairs directly, eliminating the first indirection, increasing locality of reference and reducing memory use and heap fragmentation. Further, if Java supported generic primitive types, keys and values could be stored in the array directly, removing both levels of indirection.

Large arrays

Java has been criticized for not supporting arrays of 231 (about 2.1 billion) or more elements. [16] [17] This is a limitation of the language; the Java Language Specification, Section 10.4, states that:

Arrays must be indexed by int values... An attempt to access an array component with a long index value results in a compile-time error. [18]

Supporting large arrays would also require changes to the JVM. [19] This limitation manifests itself in areas such as collections being limited to 2 billion elements [20] and the inability to memory map continuous file segments larger than 2 GB. [21] Java also lacks (outside of its 2D arrays) multidimensional arrays (contiguously allocated single blocks of memory accessed by a single indirection), which limits performance for scientific and technical computing. [13]

Integration of primitives and arrays

Arrays and primitives are somewhat special and need to be treated differently from classes. This has been criticized [22] because it requires many variants of functions when creating general-purpose libraries.

Parallelism

Per Brinch Hansen argued in 1999 [23] that Java's implementation of parallelism in general, and monitors in particular, does not provide the guarantees and enforcements required for secure and reliable parallel programming. While a programmer can establish design and coding conventions, the compiler can make no attempt to enforce them, so the programmer may unwittingly write insecure or unreliable code.

Serialization

Java provides a mechanism for object serialization, where an object can be represented as a sequence of bytes that includes its data fields, together with type information about itself and its fields. After an object is serialized, it can later be deserialized; that is, the type information and bytes that represent its data can be used to recreate the object in memory. [24] This raises very serious theoretical and actual security risks. [25] [26]

Floating point arithmetic

Although Java's floating point arithmetic is largely based on IEEE 754 (Standard for Binary Floating-Point Arithmetic), some mandated standard features are not supported even when using the strictfp modifier, such as Exception Flags and Directed Roundings. The extended precision types defined by IEEE 754 (and supported by many processors) are not supported by Java. [27] [28] [29]

Lack of tuples

Java does not natively support tuples, resulting in a proliferation of third-party implementations which must be imported and handled by the programmer. [30]

Lambda expressions

Until Java 8 introduced lambda expressions, it was difficult to pass a method as a parameter to another method.

Abstracted relationship between code and hardware

In 2008 the United States Department of Defense's Center Software Technology Support published an article in the "Journal of Defense Software Engineering" discussing the unsuitability of Java as the first language taught. Disadvantages were that students "had no feeling for the relationship between the source program and what the hardware would actually do" and the impossibility "to develop a sense of the run-time cost of what is written because it is extremely hard to know what any method call will eventually execute". [31] In 2005 Joel Spolsky criticized Java as an overfocused part of universities' curricula in his essay The Perils of JavaSchools. [32] Others, like Ned Batchelder, disagree with Spolsky for criticizing the parts of the language that he found difficult to understand, claiming that Spolsky's commentary was more of a 'subjective rant'. [33]

Performance

Before 2000, when the HotSpot VM was implemented in Java 1.3, there were many criticisms of its performance. Java has been demonstrated to run at a speed comparable with optimized native code, and modern JVM implementations are regularly benchmarked as one of the fastest language platforms available typically no more than three times slower than C and C++. [34]

Performance has improved substantially since early versions. [35] Performance of JIT compilers relative to native compilers has been shown to be quite similar in some optimized tests. [35] [36] [37]

Java bytecode can either be interpreted at run time by a virtual machine, or be compiled at load time or run time into native code which runs directly on the computer's hardware. Interpretation is slower than native execution, but compilation at load time or run time has an initial performance penalty. Modern JVM implementations all use the compilation approach, so after the initial startup time the performance is similar to native code.

Game designer and programmer John D. Carmack concluded in 2005 about Java on cell-phones: "The biggest problem is that Java is really slow. On a pure cpu / memory / display / communications level, most modern cell phones should be considerably better gaming platforms than a Game Boy Advance. With Java, on most phones you are left with about the CPU power of an original 4.77 mhz (sic) IBM PC, and lousy control over everything." [38]

Security

The Java platform provides a security architecture [39] which is designed to allow the user to run untrusted bytecode in a "sandboxed" manner to protect against malicious or poorly written software. This "sandboxing" feature is intended to protect the user by restricting access to platform features and APIs which could be exploited by malware, such as accessing the local filesystem or network, or running arbitrary commands.

In 2010, there was a significant rise in malicious software targeting security flaws in the sandboxing mechanisms used by Java implementations, including Oracle's. These flaws allow untrusted code to bypass the sandbox restrictions, exposing the user to attacks. Flaws were fixed by security updates, but were still exploited on machines without the updates. [40]

Critics have suggested that users do not update their Java installations because they don't know they have them, or how to update them. Many organisations restrict software installation by users, but are slow to deploy updates. [40] [41]

Oracle has been criticized for not promptly providing updates for known security bugs. [42] When Oracle finally released a patch for widely-exploited flaws in Java 7, it removed Java 6 from users' machines, despite it being widely used by enterprise applications that Oracle had stated were not impacted by the flaws. [43]

In 2007, a research team led by Marco Pistoia exposed another important flaw of the Java security model, [44] based on stack inspection. When a security-sensitive resource is accessed, the security manager triggers code that walks the call stack, to verify that the codebase of each method on it has authority to access the resource. This is done to prevent confused deputy attacks, which take place every time a legitimate, more privileged program is tricked by another into misusing its authority. The confused-deputy problem is a specific type of privilege escalation. Pistoia observed that when a security-sensitive resource is accessed, the code responsible for acquiring the resource may no longer be on the stack. For example, a method executed in the past may have modified the value of an object field that determines which resource to use. That method call may no longer be on the stack when it is inspected.

Some permissions are implicitly equivalent to Java's AllPermission. These include the permission to change the current security manager (and replace it with one that could potentially bypass the stack inspection), the permission to instantiate and use a custom class loader (which could choose to associate AllPermission to a malicious class upon loading it), and the permission to create a custom permission (which could declare itself as powerful as AllPermission via its implies method). These issues are documented in Pistoia's two books on Java Security. [45] [46]

Parallel installations

Before Java 7, the installers would not remove older Java installations. It was common on a Windows system to see multiple installations of Java on the same computer. [47] [48] [49] Multiple installations were permitted and could be used by programs that rely on specific versions, including malicious programs. This issue was addressed in Java 7: with the user's permission, the installer removes earlier installations. [50]

Automatic updates

As of 2014, common third-party tools (such as Adobe Flash and Adobe Reader) have been the subject of scrutiny for security vulnerabilities. Adobe and others have moved to automatic updates on Windows. These don't need any user action, and assure that security issues are promptly resolved with minimal effort by users or administrators.

As of 2015, Java 8 still requires users to update Java themselves. But on Windows only those with administrator privileges can update software. The Windows Java updater frequently triggers a disruptive User Account Control elevation prompt: whatever users choose, they still get the same "Java needs to be updated" message.

JIT compilation fundamentally uses executable data, and thus poses security challenges and possible exploits.

See also

Notes

  1. Wong, William (27 May 2002). "Write Once, Debug Everywhere". electronicdesign.com. Archived from the original on 21 March 2009. Retrieved 3 August 2008. So far, the "write-once, run-everywhere" promise of Java hasn't come true. The bulk of a Java application will migrate between most Java implementations, but taking advantage of a VM-specific feature causes porting problems.
  2. "Generics in Java". Object Computing, Inc. Archived from the original on 2 January 2007. Retrieved 9 December 2006.
  3. "What's Wrong With Java: Type Erasure". 6 December 2006. Archived from the original on 22 July 2012. Retrieved 9 December 2006.
  4. "Type Erasure".
  5. Amin, Nada; Tate, Ross (19 October 2016). "Java and scala's type systems are unsound: the existential crisis of null pointers". ACM SIGPLAN Notices. 51 (10): 838–848. doi: 10.1145/3022671.2984004 . ISSN   0362-1340.
  6. "Java SE Specifications".
  7. Yegge, Steve. "Execution in the Kingdom of Nouns".
  8. "Java libraries should provide support for unsigned integer arithmetic". Bug Database, Sun Developer Network. Oracle. Retrieved 18 January 2011.
  9. Owen, Sean R. (5 November 2009). "Java and unsigned int, unsigned short, unsigned byte, unsigned long, etc. (Or rather, the lack thereof)" . Retrieved 9 October 2010.
  10. "Unsigned Integer Arithmetic API now in JDK 8 (Joseph D. Darcy's Oracle Weblog)" . Retrieved 15 May 2016.
  11. "C++ Operator Overloading". 7 April 2016. Archived from the original on 5 February 2020. Retrieved 5 February 2020.
  12. Java Grande Forum Panel (November 1998). "Java Grande Forum Report: Making Java Work for High-End Computing" (PDF). SC98. Archived from the original (PDF) on 18 May 2013. Retrieved 10 February 2012.
  13. 1 2 Moreira, J.E.; S. P. Midkiff; M. Gupta; P. V. Artigas; M. Snir; R. D. Lawrence (2000). "Java programming for high-performance numerical computing". IBM Systems Journal. 39 (1): 21–56. CiteSeerX   10.1.1.13.1554 . doi:10.1147/sj.391.0021. True rectangular multidimensional arrays are the most important data structures for scientific and engineering computing.
  14. Hutchinson, Ben (14 June 2008). "The JVM needs Value Types" . Retrieved 3 February 2012.
  15. "java.util.HashMap Source Code". JDK 8. zGrepCode. Retrieved 6 August 2018.
  16. Arndt, Holger; Bundschus, Markus; Naegele, Andreas (2009). "Towards a Next-Generation Matrix Library for Java" (PDF). 2009 33rd Annual IEEE International Computer Software and Applications Conference. pp. 460–467. CiteSeerX   10.1.1.471.7567 . doi:10.1109/compsac.2009.67. ISBN   978-0-7695-3726-9. S2CID   14672978. ...it is not possible in Java to have arrays with more than 231 entries...
  17. "Why does Java's Collection.size() return an int?". Stack Overflow. Archived from the original on 26 March 2013. Retrieved 10 February 2012.
  18. James Gosling; Bill Joy; Guy Steele; Gilad Bracha. "The Java Language Specification" (Third ed.). Addison Wesley. Retrieved 6 February 2012.
  19. Lowden, James (24 March 2009). "Proposal: Large arrays (take two)". Java.net coin-dev mailing list. Retrieved 10 February 2012.
  20. "java.util.Collection". Java™ Platform, Standard Edition 7 API Specification. Retrieved 10 February 2012.
  21. "java.nio.ByteBuffer". Java™ Platform, Standard Edition 7 API Specification. Retrieved 6 February 2012.
  22. Sherman R. Alpert (IBM) (1998). "Primitive Types Considered Harmful". Java Report, November, 1998 (Volume 3, Number 11). Retrieved 18 November 2015.
  23. Brinch Hansen (April 1999). "Java's Insecure Parallelism" (PDF). SIGPLAN. Retrieved 13 October 2012.; alternate url
  24. Serialization and Deserialization in Java with Example by geeksforgeeks website
  25. Serialization Must Die Security issues and problems with serialization of random objects. by dzone.com
  26. Bloch, Joshua (2018). Effective Java. Addison-Wesley. pp. 339–345. ISBN   978-0-13-468599-1.
  27. Kahan, W.; Joseph D. Darcy (1 March 1998). "How Java's Floating-Point Hurts Everyone Everywhere" (PDF). Retrieved 9 December 2006.
  28. "Types, Values, and Variables". Sun Microsystems. Retrieved 9 December 2006.
  29. "Java theory and practice: Where's your point? Tricks and traps with floating point and decimal numbers". IBM. 1 January 2003. Retrieved 19 November 2011.
  30. "What's Wrong in Java 8, Part V: Tuples - DZone". dzone.com. Retrieved 18 March 2023.
  31. Robert B.K. Dewar; Edmond Schonberg (1 January 2008). "Computer Science Education: Where Are the Software Engineers of Tomorrow?". CrossTalk Jan 2008. U.S. DOD Software Technology Support Center. Archived from the original on 12 April 2009. Retrieved 15 March 2015. The Pitfalls of Java as a First Programming Language [...] Students found it hard to write programs that did not have a graphic interface, had no feeling for the relationship between the source program and what the hardware would actually do, and (most damaging) did not understand the semantics of pointers at all, which made the use of C in systems programming very challenging.
  32. Joel Spolsky (29 December 2005). "Joel on Software - The Perils of JavaSchools". joelonsoftware . Retrieved 18 November 2015. It's bad enough that JavaSchools fail to weed out the kids who are never going to be great programmers, which the schools could justifiably say is not their problem. Industry, or, at least, the recruiters-who-use-grep, are surely clamoring for Java to be taught. But JavaSchools also fail to train the brains of kids to be adept, agile, and flexible enough to do good software design
  33. Ned Batchelder (1 January 2006). "Joel Spolsky is a crotchety old man". nedbatchelder.com . Retrieved 2 February 2016. Why does Joel pick out pointers and recursion as the two gatekeeper concepts? Because he found them difficult? As Tim Bray points out, Java is perfectly adept at recursion, and concurrency may be a more important and difficult concept to master in any case. The emphasis on recursion in Lisp languages is a bit over the top, and doesn't carry into other programming cultures. Why do people think it's so important for software engineering? Don't get me wrong: I love recursion when it's the right tool for the job, but that is just not that often to warrant Joel's focus on it as a fundamental concept.
    While we're hunting around for tough concepts that separate the men from the boys, what about the one that got Joel and I into a tussle two years ago: Exceptions. He doesn't like them, basically, because they confuse him. Is this any different than a Java guy not liking pointers? Yes, you can avoid exceptions and use status returns, but you can also try really hard to avoid pointers. Does that mean you should? So Joel's got the concepts he likes (pointers and recursion), and laments their decline, but doesn't seem to notice that there are newer concepts that he's never caught on to, which the Java kiddies feel at home with.
  34. "Computer Language Benchmarks Game: Java vs Gnu C++". benchmarksgame.alioth.debian.org. Archived from the original on 13 January 2015. Retrieved 19 November 2011.
  35. 1 2 J.P.Lewis & Ulrich Neumann. "Performance of Java versus C++". Graphics and Immersive Technology Lab, University of Southern California.
  36. "The Java Faster than C++ Benchmark" . Retrieved 15 May 2016.
  37. FreeTTS - A Performance Case Study Archived 25 March 2009 at the Wayback Machine , Willie Walker, Paul Lamere, Philip Kwok
  38. John D. Carmack (27 March 2005). "Cell phone adventures". John Carmack's Blog. armadilloaerospace.com. Archived from the original on 24 November 2015. Retrieved 10 November 2015.
  39. Java SE Platform Security Architecture. Oracle. Retrieved 2013-04-23.
  40. 1 2 "Researchers Highlight Recent Uptick in Java Security Exploits".
  41. "Have you checked the Java?". Archived from the original on 21 September 2012. Retrieved 25 November 2010.
  42. "Oracle knew about critical Java flaws since April". The Register . 30 August 2012. Retrieved 30 August 2012.
  43. "'Silent but deadly' Java security update breaks legacy apps - dev". The Register . Retrieved 15 May 2016.
  44. Pistoia, Marco; Banerjee, Anindya; Naumann, David A. (May 2007). "Beyond Stack Inspection: A Unified Access-Control and Information-Flow Security Model". 2007 IEEE Symposium on Security and Privacy (SP '07). IEEE. pp. 149–163. doi:10.1109/sp.2007.10. ISBN   978-0-7695-2848-9. S2CID   4112294.
  45. Pistoia, Marco, ed. (1999). Java 2 network security. ITSO networking series (2. ed.). Upper Saddle River, New Jersey: Prentice Hall. ISBN   978-0-13-015592-4.
  46. Pistoia, Marco, ed. (2004). Enterprise Java security: building secure J2EE applications. Boston, Mass. Munich: Addison-Wesley. ISBN   978-0-321-11889-9.
  47. Grimes, Roger A. (15 November 2011). "Old Java versions breed new security exploits". InfoWorld. Retrieved 10 September 2023.
  48. Krill, Paul (4 May 2012). "Oracle urges removal of older Java versions due to security risks". InfoWorld. Retrieved 10 September 2023.
  49. "Why should I uninstall older versions of Java from my system?". Java. 10 September 2023. Retrieved 10 September 2023.
  50. "Java 6 Auto-Update to Java 7". Oracle. 10 September 2023. Retrieved 10 September 2023.

Related Research Articles

<span class="mw-page-title-main">Java applet</span> Small application written in Java

Java applets were small applications written in the Java programming language, or another programming language that compiles to Java bytecode, and delivered to users in the form of Java bytecode. The user launched the Java applet from a web page, and the applet was then executed within a Java virtual machine (JVM) in a process separate from the web browser itself. A Java applet could appear in a frame of the web page, a new application window, a program from Sun called appletviewer, or a stand-alone tool for testing applets.

<span class="mw-page-title-main">Java (programming language)</span> Object-oriented programming language

Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let programmers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need to recompile. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the underlying computer architecture. The syntax of Java is similar to C and C++, but has fewer low-level facilities than either of them. The Java runtime provides dynamic capabilities that are typically not available in traditional compiled languages.

<span class="mw-page-title-main">Java virtual machine</span> Virtual machine that runs Java programs

A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describes what is required in a JVM implementation. Having a specification ensures interoperability of Java programs across different implementations so that program authors using the Java Development Kit (JDK) need not worry about idiosyncrasies of the underlying hardware platform.

Java Platform, Standard Edition is a computing platform for development and deployment of portable code for desktop and server environments. Java SE was formerly known as Java 2 Platform, Standard Edition (J2SE).

Java and C++ are two prominent object-oriented programming languages. By many language popularity metrics, the two languages have dominated object-oriented and high-performance software development for much of the 21st century, and are often directly compared and contrasted. Java's syntax was based on C/C++.

Hungarian notation is an identifier naming convention in computer programming in which the name of a variable or function indicates its intention or kind, or in some dialects, its type. The original Hungarian notation uses only intention or kind in its naming convention and is sometimes called Apps Hungarian as it became popular in the Microsoft Apps division in the development of Microsoft Office applications. When the Microsoft Windows division adopted the naming convention, they based it on the actual data type, and this convention became widely spread through the Windows API; this is sometimes called Systems Hungarian notation.

<span class="mw-page-title-main">Data type</span> Attribute of data

In computer science and computer programming, a data type is a collection or grouping of data values, usually specified by a set of possible values, a set of allowed operations on these values, and/or a representation of these values as machine types. A data type specification in a program constrains the possible values that an expression, such as a variable or a function call, might take. On literal data, it tells the compiler or interpreter how the programmer intends to use the data. Most programming languages support basic data types of integer numbers, floating-point numbers, characters and Booleans.

In software design, the Java Native Interface (JNI) is a foreign function interface programming framework that enables Java code running in a Java virtual machine (JVM) to call and be called by native applications and libraries written in other languages such as C, C++ and assembly.

In computer science, primitive data types are a set of basic data types from which all other data types are constructed. Specifically it often refers to the limited set of data representations in use by a particular processor, which all compiled programs must use. Most processors support a similar set of primitive data types, although the specific representations vary. More generally, "primitive data types" may refer to the standard data types built into a programming language. Data types which are not primitive are referred to as derived or composite.

<span class="mw-page-title-main">Apache Groovy</span> Programming language

Apache Groovy is a Java-syntax-compatible object-oriented programming language for the Java platform. It is both a static and dynamic language with features similar to those of Python, Ruby, and Smalltalk. It can be used as both a programming language and a scripting language for the Java Platform, is compiled to Java virtual machine (JVM) bytecode, and interoperates seamlessly with other Java code and libraries. Groovy uses a curly-bracket syntax similar to Java's. Groovy supports closures, multiline strings, and expressions embedded in strings. Much of Groovy's power lies in its AST transformations, triggered through annotations.

In computer programming, specifically object-oriented programming, a class invariant is an invariant used for constraining objects of a class. Methods of the class should preserve the invariant. The class invariant constrains the state stored in the object.

This article compares two programming languages: C# with Java. While the focus of this article is mainly the languages and their features, such a comparison will necessarily also consider some features of platforms and libraries. For a more detailed comparison of the platforms, see Comparison of the Java and .NET platforms.

A Java class file is a file containing Java bytecode that can be executed on the Java Virtual Machine (JVM). A Java class file is usually produced by a Java compiler from Java programming language source files containing Java classes. If a source file has more than one class, each class is compiled into a separate class file.

<span class="mw-page-title-main">Scala (programming language)</span> General-purpose programming language

Scala is a strong statically typed high-level general-purpose programming language that supports both object-oriented programming and functional programming. Designed to be concise, many of Scala's design decisions are intended to address criticisms of Java.

<span class="mw-page-title-main">Java (software platform)</span> Set of computer software and specifications

Java is a set of computer software and specifications that provides a software platform for developing application software and deploying it in a cross-platform computing environment. Java is used in a wide variety of computing platforms from embedded devices and mobile phones to enterprise servers and supercomputers. Java applets, which are less common than standalone Java applications, were commonly run in secure, sandboxed environments to provide many features of native applications through being embedded in HTML pages.

The Java language has undergone several changes since JDK 1.0 as well as numerous additions of classes and packages to the standard library. Since J2SE 1.4, the evolution of the Java language has been governed by the Java Community Process (JCP), which uses Java Specification Requests (JSRs) to propose and specify additions and changes to the Java platform. The language is specified by the Java Language Specification (JLS); changes to the JLS are managed under JSR 901. In September 2017, Mark Reinhold, chief Architect of the Java Platform, proposed to change the release train to "one feature release every six months" rather than the then-current two-year schedule. This proposal took effect for all following versions, and is still the current release schedule.

Generics are a facility of generic programming that were added to the Java programming language in 2004 within version J2SE 5.0. They were designed to extend Java's type system to allow "a type or method to operate on objects of various types while providing compile-time type safety". The aspect compile-time type safety was not fully achieved, since it was shown in 2016 that it is not guaranteed in all cases.

Java bytecode is the instruction set of the Java virtual machine (JVM), crucial for executing programs written in the Java language and other JVM-compatible languages. Each bytecode operation in the JVM is represented by a single byte, hence the name "bytecode", making it a compact form of instruction. This intermediate form enables Java programs to be platform-independent, as they are compiled not to native machine code but to a universally executable format across different JVM implementations.

The Java software platform provides a number of features designed for improving the security of Java applications. This includes enforcing runtime constraints through the use of the Java Virtual Machine (JVM), a security manager that sandboxes untrusted code from the rest of the operating system, and a suite of security APIs that Java developers can utilise. Despite this, criticism has been directed at the programming language, and Oracle, due to an increase in malicious programs that revealed security vulnerabilities in the JVM, which were subsequently not properly addressed by Oracle in a timely manner.

Kotlin is a cross-platform, statically typed, general-purpose high-level programming language with type inference. Kotlin is designed to interoperate fully with Java, and the JVM version of Kotlin's standard library depends on the Java Class Library, but type inference allows its syntax to be more concise. Kotlin mainly targets the JVM, but also compiles to JavaScript or native code via LLVM. Language development costs are borne by JetBrains, while the Kotlin Foundation protects the Kotlin trademark.