About
:octocat: GitHub: All of the example code: repo (link)
:page_facing_up: blog link: https://purrgramming.life/cs/programming/fp/ :star:
Intro
A pure object-oriented language is one in which every value is an object.
This description concerns the language-level object model, not a guarantee about runtime allocation or the complete set of type expressions.
Is Scala a pure object-oriented language?
Scala offers a uniform object-oriented model: values support operations and participate in its type system. This coexists with functional programming. It does not mean every Scala type is itself a class declaration, or every value is separately heap-allocated.
Details
At the language level, numeric values and functions fit the object model. On the JVM, value types may use unboxed primitives or boxed objects, depending on context.
Conceptually, types such as Int or Boolean do not receive special treatment in Scala. They are like the other classes, defined in the package scala.
Java vs Scala
In short, Java is not a pure object-oriented programming language because it supports primitive data types, and everything is not an object in Java.
Examples
For a conceptual exercise, model a Boolean with methods choosing between two arguments, then compare that model with the compiler’s efficient runtime representation. The original time-limited course PDF link has expired; course access belongs at the official course page.
Takeaway
Use the object model to reason about interfaces and behavior, and the runtime model to reason about allocation and performance. They answer different questions.
Reference: Scala terminology and runtime representations.