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

Scala example source code file (t3038.scala)

This example Scala source code file (t3038.scala) 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, app, app, b, b, c, test, test

The Scala t3038.scala source code

class A {
  private lazy val a1 = "a1"
  object B
  private lazy val a2 = "a2"
  

  @transient lazy val a3 = "a3"
  @transient private lazy val a4 = "a4"
  @transient lazy val a5 = "a5"
  @transient private lazy val a6 = "a6"
  
  final val a7 = "a7"
  private final val a8 = "a8"
  @transient final val a9 = "a9"
  
  


  def run = {
    println(a1)
    B
    println(a2)
    println(a3)
    println(a4)
    println(a5)
    println(a6)
    println(a7)
    println(a8)
    println(a9)
  }  
}

class C extends A {
  private lazy val c1 = "c1"
  lazy val c2 = "c2"
  
  private lazy val c3 = "c3"

  @transient lazy val c4 = "c4"
  @transient private lazy val c5 = "c5"
  @transient lazy val c6 = "c6"
  @transient private lazy val c7 = "c7"
  lazy val c8 = "c8"
      
  final val c9 = "c9"
  private final val c10 = "c10"



  override def run = {
    super.run
    println(c1)
    println(c2)
    println(c3)
    println(c4)
    println(c5)
    println(c6)
    println(c7)
    println(c8)
    println(c9)
    println(c10)
  }
}

object Test extends App {
  (new C).run
}

Other Scala examples (source code examples)

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