Simple Scala List of Char

I have just started learning Scala.  I started by playing with a Hello World example, with some with head, tail, and List of Char[]:

package greeter

object HelloWorld {
  def main(args: Array[String]) {
    val greeting: String = "Hello, world!"          // String
    println(greeting)
    println(greeting.head)                          // Get the first char
    println(greeting.tail)                          // Get the rest

    val charList: List[Char] = List('a','b','c')    // List of Char

    print (charList(0))                             // Print the first character

    val charListFromString = greeting.toList        // String to list
    println()                                       // Print blank line
    print (charListFromString(0))
  }
}

Author | Miles Davenport

Career programmer, who designs, assembles, fixes, and supports customers, software and systems.