alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (repl-bare-expr.check)

This example Scala source code file (repl-bare-expr.check) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

bovine, cow, cow, int, int, list, list, moo, moo, moooooo, ruminant, type

The Scala repl-bare-expr.check source code

Type in expressions to have them evaluated.
Type :help for more information.

scala> 

scala> 2 ; 3
res0: Int = 3

scala> { 2 ; 3 }
res1: Int = 3

scala> 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
  1 +
  2 +
  3 } ; bippy+88+11
defined module Cow
defined class Moo
bippy: Int
res2: Int = 105

scala> 

scala> object Bovine { var x: List[_] = null } ; case class Ruminant(x: Int) ; bippy * bippy * bippy
defined module Bovine
defined class Ruminant
res3: Int = 216

scala> Bovine.x = List(Ruminant(5), Cow, new Moo)
Bovine.x: List[Any] = List(Ruminant(5), Cow, Moooooo)

scala> Bovine.x
res4: List[Any] = List(Ruminant(5), Cow, Moooooo)

scala> 

scala> 

Other Scala examples (source code examples)

Here is a short list of links related to this Scala repl-bare-expr.check source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.