home | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (classof.scala)

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

arrays, boolean, functions, int, int, map, someclass, someclass, string, test, test, unit, unit, value

The Scala classof.scala source code

class SomeClass

object Test {
  def main(args: Array[String]): Unit = {
    val cls: Predef.Class[SomeClass] = classOf[SomeClass]
    println("Value types:")
    println(classOf[Unit])
    println(classOf[Boolean])
    println(classOf[Byte])
    println(classOf[Short])
    println(classOf[Char])
    println(classOf[Int])
    println(classOf[Long])
    println(classOf[Float])
    println(classOf[Double])
    
    println("Class types")
    println(classOf[SomeClass])
    println(classOf[List[Array[Float]]])
    println(classOf[(String, Map[Int, String])])

    println("Arrays:")
    println(classOf[Array[Unit]])    
    println(classOf[Array[Int]])
    println(classOf[Array[Double]])
    println(classOf[Array[List[String]]])

    println("Functions: ")
    println(classOf[(Int, Int) => Unit])
    println(classOf[Int => Boolean])
  }
}

Other Scala examples (source code examples)

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



my book on functional programming

 

new blog posts

 

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