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

Scala example source code file (lazyvals.check)

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

a, a, c, double, int, int, o, object, object, only, only, t, use

The Scala lazyvals.check source code

lazyvals.scala:6: error: lazy values may not be abstract
  lazy val t: Int
           ^
lazyvals.scala:9: error: lazy not allowed here. Only vals can be lazy
  lazy var p: Int = 100
       ^
lazyvals.scala:12: error: lazy not allowed here. Only vals can be lazy
  lazy def q: Double = 0.0
       ^
lazyvals.scala:15: error: '=' expected but ';' found.
    lazy val t;
              ^
lazyvals.scala:20: error: lazy not allowed here. Only vals can be lazy
  lazy trait T {}
       ^
lazyvals.scala:21: error: lazy not allowed here. Only vals can be lazy
  lazy class C {}
       ^
lazyvals.scala:22: error: lazy not allowed here. Only vals can be lazy
  lazy object O {}
       ^
lazyvals.scala:25: error: lazy modifier not allowed here. Use call-by-name parameters instead
  class A(lazy val obj: Object) {}
               ^
8 errors found

Other Scala examples (source code examples)

Here is a short list of links related to this Scala lazyvals.check source code file:

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

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 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.