
October 29th, 2007, 05:03 PM
|
|
Contributing User
|
|
Join Date: Nov 2006
Posts: 82
  
Time spent in forums: 2 Days 3 h 48 m 14 sec
Reputation Power: 4
|
|
|
Printf in Scala
Ok, I need some help figuring out why this won't work. Here's some simple code:
Scala Code:
Original
- Scala Code |
|
|
|
object Blah{
def main(args: Array[String]): unit = {
Console.printf("Hello, {0}","world!");
}
}
When I try to compile it with scalac Blah.scala, I get this error:
Code:
Blah.scala:3 error: wrong number of arguments for method printf: (java.lang.String)(scala.Any*)scala.Unit
Console.printf("Hello, {0}","world!");
^
one error found
But the Scala API says the definition of Console.printf is:
Scala Code:
Original
- Scala Code |
|
|
|
def printf(text: String, args: Any*): Unit
So, uh, shouldn't my code compile?
|