Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old October 29th, 2007, 05:03 PM
dustpyle_x3 dustpyle_x3 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2006
Posts: 82 dustpyle_x3 User rank is Corporal (100 - 500 Reputation Level)dustpyle_x3 User rank is Corporal (100 - 500 Reputation Level)dustpyle_x3 User rank is Corporal (100 - 500 Reputation Level)dustpyle_x3 User rank is Corporal (100 - 500 Reputation Level) 
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?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Printf in Scala


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway