Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>One of the things you're seeing is that Scala is, above all, a strongly-typed functional language <em>on the JVM</em></p> <p>Scala is not <em>just</em> a Functional language. It did start off as one (Funnel: <a href="http://lamp.epfl.ch/funnel/" rel="nofollow noreferrer">http://lamp.epfl.ch/funnel/</a>), but this was then extended to make it an Object-Oriented language, with the explicit goal of making it strongly interoperable with Java classes.</p> <p>abstraction and overriding and packages are all examples of this interoperability in action.</p> <hr> <p>The remainder might be considered not as new features, but simply as removing restrictions from Java. Taking them one at a time:</p> <p><strong>traits and object hierarchy linearization</strong></p> <p>Removes the restriction that Java interfaces can only contain abstract methods. Linearisation is how Scala resolves the diamond-inheritance problems that this would otherwise cause.</p> <p><strong>singletons</strong></p> <p>Java static methods are a hangover from it's C++ syntax heritage, which in turn added them to better support the procedural style need for interop with C. Static methods are very much NOT object oriented (see this question: <a href="https://stackoverflow.com/questions/4112088/why-are-singleton-objects-more-object-orientated/4112864#4112864">Why are singleton objects more object-oriented?</a>)</p> <p><strong>companion objects</strong></p> <p>Allow singletons to be used in lieu of static methods, with their privileged access rights. </p> <p><strong>implicit conversions</strong></p> <p>Java already does this, but it's restricted to only implicitly converting objects and primitives to strings, as in the expression <code>"" + 3</code>. Scala just extends this idea and allows the programmer to use it for other conversions.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload