// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
package jwj

object O {
    def m(): Unit = {
        println("O.m")
    }
}

object SC {
  var compf: Int = 0
}

class SC {
  import SC._
  compf = compf + 1
  var instf: Int = compf
  override def toString(): String = {
     return s"$instf of $compf" 
  }
}

object OO2 {
  def main(args: Array[String]): Unit = {
    O.m()
    val o1 = new SC()
    println(o1)
    val o2 = new SC()
    println(o1)
    println(o2)
  }
}
