Scala - Java

Card Puncher Data Processing

About

All classes from the java.lang package are imported by default, while others need to be imported explicitly.

Example

Java’s class libraries define powerful utility classes, such as Date and DateFormat.

import java.util.{Date, Locale}
import java.text.DateFormat
import java.text.DateFormat._

object FrenchDate {
  def main(args: Array[String]) {
    val now = new Date
    val df = getDateInstance(LONG, Locale.FRANCE)
    println(df format now)
  }
}







Share this page:
Follow us:
Task Runner