Course 'Object-Oriented Compatibility'

The "Learning Scala Using The REPL" lecture is not free and you are not enrolled in the course, or you are not logged in. Information about the lecture follows. Click on the About the Course and Course Outline tabs above to learn more about the course. You can enroll by clicking on the button on the upper right of this page.

Lecture Contents

UTF-8 and Backquotes

Scala / Java Interoperability

Java to Scala

Scala to Java

95% Runtime Fidelity

Exercise 1

Solution 1

Everything is an Expression

Pasting a Transcript

Exploring Scala with the REPL



Long Integers

Hex Integers


Floating Point





until and the indices Idiom

Other Scala Control Statements


Scala assignment returns Unit

do while


Exercise 2

Solution 2

Exercise 3

Solution 3

Scala REPL Here Documents

Scala 2.11.8+ Tab Completion

Reliable completion

CamelCase completion

Show desugarings performed by the compiler

Complete bean getters

Find members by typing any CamelCased part of the name

Complete non-qualified names, including types

Press TAB twice to see the method signature

References: Lecture Higher-Order Functions
Lecture Collections Overview
Lecture Immutable Collections
Lecture For-Loops and For-Comprehensions
Lecture Memoization in Depth
Lecture Classes Part 1
Lecture Setters, Getters and the Uniform Access Principle
Lecture More Fun With Functions
Lecture Lambda Review & Drill
Lecture Ensime
Lecture Working With Scala-IDE for Eclipse
Referenced by: Lecture Routes and Dispatching to Controllers
Lecture Collections Overview
Lecture Hash Tables
Lecture Immutable Collections
Lecture For-Loops and For-Comprehensions
Lecture Type Hierarchy and Equality
Lecture Functions are First Class
Lecture Self Types vs Inheritance


A first look at some simple Scala programs and how to run them using the Scala REPL. Variable and method definitions, string interpolation and some simple looping constructs are introduced.

Revision History

Date Changes
2019-04-22 Added new Literals section to the transcript, with information about Scala 2.13
2017-02-24 Republished video
2016-03-02 Enhanced REPL the here docs section in the transcript with three Scala 2.11.8 examples
2015-12-21 Added Scala REPL Here Docs section (new for Scala 2.11.8)
2015-11-19 Republished video discussing REPL changes for Scala 2.11.8 & 2.12
2015-10-09 Added Scala 2.11.8/2.12 Improvements section
2015-07-09 Republished video
2015-07-07 Added the until and the indices Idiom section
2015-07-01 Added Scala / Java Interoperability section
2015-02-10 Added 95% Runtime Fidelity and Pasting a Transcript sections, added information on string interpolation, recreated entire video
2013-12-21 First published transcript and video for Scala 2.10.3

This course is based on Scala 2.10 and Java 7, and has not been updated to Scala 2.11 or Java 8. Updating this course to a newer version of Java or Scala is currently a low priority.

This course focuses on Java/Scala interoperability. It provide students the knowledge and techniques to work with combined Scala/Java code bases in all their forms.

  1. The first section of this course helps you install Scala tools, including a brief refresher on how to use the three most popular choices of programming tools: a text editor with SBT, Eclipse and IntelliJ IDEA. Pick the toolchain that you are most comfortable with, watch the videos of interest and follow along. Within minutes you will have all of the code examples provided in the course compiled and running.
  2. The second section of this course shows you how Scala programs can work with Java code and data structures. This material is quite short, and is exactly what you would expect, with one notable exception, as you will see as you go through the course.
  3. The third section of this course shows you how to work with a Java dissembler and interpret what it shows you. After a quick review of Scala's object-oriented features, you will learn how to discover the proper incantations to call Scala code from Java, and to work with Scala data structures from Java.
  4. The fourth section of this course shows you how to access Scala objects and data from Java.
  5. The last section of this course offers guidance on how to write Scala code so it can be readily accessed from both Scala and Java.

This course is a well-organized and complete source of information on how to make Java and Scala code work together effectively. Students will learn how to write Java code that uses the Scala runtime as if it was just a very capable Java library, and to write Scala code that exposes the advanced features of Scala so Java programmers can use it without even knowing that it was written in Scala. If you need to develop software that is a blend of Java and Scala code, this course will give a solid foundation for intermediate and advanced Scala programmers. For example, you will learn how to structure a model so it can be used from Scala and Java code, while providing all the benefits of Scala.

How to Study This Course

The video on the front page of this web site discusses how to study this course. The transcript tab contains the same information as the video in written form.


Intermediate Scala course or equivalent.

Date Lecture Changes
2015-07-28 Quiz 1 on Setters and Getters Hived from Routes and Dispatching to Controllers
2013-11-04   Early access for this course ended
2013-06-01   Early access for this course began
Price: $249usd