Hi Saifi, Oh ,I was thinking the java way...got it
thanks, SMS On Thu, Jun 18, 2009 at 9:14 PM, Saifi Khan <[email protected]>wrote: > > > On Thu, 18 Jun 2009, Mukund Deshpande wrote: > > > Hi All, > > > > package ab.c; > > class package1{ > > def max(x:Int,y:Int){ > > if(x>y) > > println(x) > > else > > println(y) > > } > > } > > > > > > import ab.c.package1; > > class pack1main { > > def main(args:Array[String]):Unit={ > > val n= new package1(); > > n.max(5,6); > > } > > } > > > > Now whenever i execute this program every thing gets compiled but i get > an > > error pac1main.main not static > > The user class should be written as > > object package1user > { > def main(args: Array[String]): Unit= > { > val n = new package1() > n.max(5,6) > } > } > > Hope this helps. > > thanks > Saifi. > > [Non-text portions of this message have been removed]

