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

Scala example source code file (checksensible.check)

This example Scala source code file (checksensible.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

anyref, anyref, bip, boolean, bop, exception, int, int, object, object, shmoopie, symbol, unit, unit

The Scala checksensible.check source code

checksensible.scala:13: error: comparing a fresh object using `eq' will always yield false
  (new AnyRef) eq (new AnyRef)
               ^
checksensible.scala:14: error: comparing a fresh object using `ne' will always yield true
  (new AnyRef) ne (new AnyRef)
               ^
checksensible.scala:15: error: comparing a fresh object using `eq' will always yield false
  Shmoopie eq (new AnyRef)
           ^
checksensible.scala:16: error: comparing a fresh object using `eq' will always yield false
  (Shmoopie: AnyRef) eq (new AnyRef)
                     ^
checksensible.scala:17: error: comparing a fresh object using `eq' will always yield false
  (new AnyRef) eq Shmoopie
               ^
checksensible.scala:18: error: comparing a fresh object using `eq' will always yield false
  (new AnyRef) eq null
               ^
checksensible.scala:19: error: comparing a fresh object using `eq' will always yield false
  null eq new AnyRef
       ^
checksensible.scala:26: error: comparing values of types Unit and Int using `==' will always yield false
  (c = 1) == 0
          ^
checksensible.scala:27: error: comparing values of types Int and Unit using `==' will always yield false
  0 == (c = 1)
    ^
checksensible.scala:29: error: comparing values of types Int and java.lang.String using `==' will always yield false
  1 == "abc"
    ^
checksensible.scala:34: error: comparing a fresh object using `==' will always yield false
  new AnyRef == 1
             ^
checksensible.scala:37: error: comparing values of types Int and java.lang.Boolean using `==' will always yield false
  1 == (new java.lang.Boolean(true))
    ^
checksensible.scala:39: error: comparing values of types Int and Boolean using `!=' will always yield true
  1 != true
    ^
checksensible.scala:40: error: comparing values of types Unit and Boolean using `==' will always yield false
  () == true
     ^
checksensible.scala:41: error: comparing values of types Unit and Unit using `==' will always yield true
  () == ()
     ^
checksensible.scala:42: error: comparing values of types Unit and Unit using `==' will always yield true
  () == println
     ^
checksensible.scala:44: error: comparing values of types Int and Unit using `!=' will always yield true
  (1 != println)
     ^
checksensible.scala:45: error: comparing values of types Int and Symbol using `!=' will always yield true
  (1 != 'sym)
     ^
checksensible.scala:51: error: comparing a fresh object using `==' will always yield false
  ((x: Int) => x + 1) == null
                      ^
checksensible.scala:52: error: comparing a fresh object using `==' will always yield false
  Bep == ((_: Int) + 1)
      ^
checksensible.scala:54: error: comparing a fresh object using `==' will always yield false
  new Object == new Object
             ^
checksensible.scala:55: error: comparing a fresh object using `==' will always yield false
  new Object == "abc"
             ^
checksensible.scala:56: error: comparing a fresh object using `!=' will always yield true
  new Exception() != new Exception()
                  ^
checksensible.scala:59: error: comparing values of types Int and Null using `==' will always yield false
  if (foo.length == null) "plante" else "plante pas"
                 ^
checksensible.scala:64: error: comparing values of types Bip and Bop using `==' will always yield false
  (x1 == x2)
      ^
checksensible.scala:74: error: comparing values of types EqEqRefTest.this.C3 and EqEqRefTest.this.Z1 using `==' will always yield false
  c3 == z1
     ^
checksensible.scala:75: error: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `==' will always yield false
  z1 == c3
     ^
checksensible.scala:76: error: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `!=' will always yield true
  z1 != c3
     ^
checksensible.scala:77: error: comparing values of types EqEqRefTest.this.C3 and java.lang.String using `!=' will always yield true
  c3 != "abc"
     ^
checksensible.scala:88: error: comparing values of types Unit and Int using `!=' will always yield true
    while ((c = in.read) != -1)
                         ^
30 errors found

Other Scala examples (source code examples)

Here is a short list of links related to this Scala checksensible.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.