wood burning stoves 2.0*
The moose likes Scala and the fly likes problem with code.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Languages » Scala
Bookmark "problem with code...." Watch "problem with code...." New topic
Author

problem with code....

Pankaj Mittal
Ranch Hand

Joined: Jul 09, 2008
Posts: 32
Hi guys !!

I've got one strange problem....I'm using netbeans 6.5.1 with scala plugin....dunno what the prob is...but sometime this code runs sometime doesn't...



Thanks !!


2008 SCJP(5.0) 88%
Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1296
The problem is mosy likely here:



If you use the equals sign, you have to annotate the return type explicitly as Unit



Alternatively you could omit both the equals sign and the type annotation



Personally I prefer the first form over the second, because I think all top level methods should have their type explicitly annotated. But really it's a matter of preference.


Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Pankaj Mittal
Ranch Hand

Joined: Jul 09, 2008
Posts: 32
thanks....got it !!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with code....