Subj : Re: boolean usage To : eluru12005 From : Igor Bukanov Date : Tue Aug 31 2004 09:59 am eluru12005@yahoo.com wrote: > Hi, > > I am trying to learn java scriptng. I am a new user. > I am trying to pass boolean to java method and I am getting > compilation error. > > 1) First Queation > Here is the sample lines > abcd =new Boolean(false); > classKeys [] = myMethod(context, "TEST", null, null, null,abcd); That should be simply: abcd =false; classKeys = myMethod(context, "TEST", null, null, null,abcd); or abcd =false; classKeys[someIndex] = myMethod(context, "TEST", null, null, null,abcd); Rhino automaically converts primitive JS boolean values to Java boolean or java.lang.Boolean automatically and classKeys [] is not valid JS. > > 2) > even after using importPackage(Packages.my.class) > do I need to pass complete name to create host objects. You should use importClass(Packages.my) without .class suffix since importPackage(Packages.my) would import all classes in the package my. Regards, Igor .