Skip to content

Commit

Permalink
Merge pull request #674 from the0val/master
Browse files Browse the repository at this point in the history
fixed example 5.1.35 output
  • Loading branch information
bjornregnell authored Sep 26, 2022
2 parents a81cfa3 + 641b923 commit 32a8826
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slides/body/lect-w05-classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -957,13 +957,13 @@
scala> class Gurka(val vikt: Int)

scala> var g: Gurka = null // ingen instans allokerad än
val g: Gurka = null
var g: Gurka = null

scala> g.vikt
java.lang.NullPointerException

scala> g = Gurka(42) // instansen allokeras
val g: Gurka = Gurka@1ec7d8b3
g: Gurka = Gurka@1ec7d8b3

scala> g.vikt
val res0: Int = 42
Expand Down

0 comments on commit 32a8826

Please sign in to comment.