2016Unpublished venueRequires access

Java Compatibility

Alessandro Lacava, Janek Bogucki, Aliaksandr Bedrytski, Matthew de Detrich, Benjamin Neil

Open publisher page 0 citations

Abstract

This chapter shows how to convert Java collections to Scala and vice versa. It covers how Scala traits relate to Java interfaces, and details how both things can cooperate. Java enums are then mapped into the Scala world. The chapter also examines the available conversions between Scala and Java collections. The usage of Scala's traits in Java, however, needs some knowledge about how the trait is compiled to the byte-code. Unfortunately, there is not a direct translation from Java to Scala in terms of Enumeration. One can split their project to include enumeration using Java enumerations by having Java files for using Java enumeration. However, if one can handle a slight paradigm shift in how to utilize enumerations, he/she can enact one of two Scala-based alternatives. These are all examples that illustrate how the creators of Scala took the Java compatibility issue seriously.

About this research paper

What this paper is about

This chapter shows how to convert Java collections to Scala and vice versa. It covers how Scala traits relate to Java interfaces, and details how both things can cooperate. Java enums are then mapped into the Scala world. The chapter also examines the available conversions between Scala and Java collections. The usage of Scala's traits in Java, however, needs some knowledge about how the trait is compiled to the byte-code. Unfortunately, there is not a direct translation from Java to Scala in terms of Enumeration. One can split their project to include enumeration using Java enumerations by having Java files for using Java enumeration. However, if one can handle a slight paradigm shift in how to utilize enumerations, he/she can enact one of two Scala-based alternatives. These are all examples that illustrate how the creators of Scala took the Java compatibility issue seriously.

Why it matters

A significance statement is not available in the OpenAlex record.

Key contribution

A contribution statement is not available in the OpenAlex record.

Method / approach

Method details are not available in the OpenAlex metadata.

Main findings

Findings are not separately available in the OpenAlex metadata.

Limitations

Limitations are not available in the OpenAlex metadata.

Applications

Application details are not available in the OpenAlex metadata.

Available abstract

This chapter shows how to convert Java collections to Scala and vice versa. It covers how Scala traits relate to Java interfaces, and details how both things can cooperate. Java enums are then mapped into the Scala world. The chapter also examines the available conversions between Scala and Java collections. The usage of Scala's traits in Java, however, needs some knowledge about how the trait is compiled to the byte-code. Unfortunately, there is not a direct translation from Java to Scala in terms of Enumeration. One can split their project to include enumeration using Java enumerations by having Java files for using Java enumeration. However, if one can handle a slight paradigm shift in how to utilize enumerations, he/she can enact one of two Scala-based alternatives. These are all examples that illustrate how the creators of Scala took the Java compatibility issue seriously.

Key concepts: Scala, Java, Computer science, Generics in Java, Java annotation, Programming language, Real time Java, Java Modeling Language

Related papers

Back to paper searchBrowse research topicsOriginal source
Java Compatibility — Research Paper | ScholarLens