Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Scala: Through the Eyes of Java#

Sumit Rawal answered on May 23, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers


Scala: Through the Eyes of Java#

0

Martin Odersky’s primary influence when developing Scala was the Java programming language, so much so that Scala is actually written to run in Java Virtual Machine. Scala programs compile to JVM bytecodes, and their runtime performance is mostly on par with Java programs. If you are not familiar with bytecode, that’s perfectly fine. All you need to know is that Java programs don’t compile into executable files; instead, they compile into bytecodes which are then executed during runtime.

Scala allows you to call Java methods, access Java fields, inherit from Java classes, and implement Java interfaces in your code without the added requirement of any special syntax. Programmers are not even aware of how heavily Scala code makes use of Java libraries.

Scala also reuses Java types. Scala’s Int is represented as Java’s int, Scala’s Float is represented as Java’s float, and so on. Scala’s string literals are of type java.lang.String and Java’s string methods can be called on them.

While the parallels between Java and Scala are evident, Scala differs in many ways as well with its code being much more concise, clean, and with its own benefits. 

Popularity 1/10 Helpfulness 1/10 Language java
Source: Grepper
Tags: java
Link to this answer
Share Copy Link
Contributed on May 23 2023
Sumit Rawal
0 Answers  Avg Quality 2/10


X

Continue with Google

By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
X
Grepper Account Login Required

Oops, You will need to install Grepper and log-in to perform this action.