File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Languages » Scala
Bookmark "problem with code...." Watch "problem with code...." New topic

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 it !!
I agree. Here's the link:
subject: problem with code....
It's not a secret anymore!