Hi,

If the function prototype expects java.lang.Integer, Inline::Java will
box it for you:

  use Inline Java => <<'END' ;
  public class A {
    public static int inc(Integer i) {
      return i.intValue() + 1 ;
    }
  }
  END

  print A->inc(5), "\n" ;


This will print 6.


Patrick

On Tue, Sep 7, 2010 at 2:08 AM, Siva Krishna Kumar Balijepalli
<bsk...@gmail.com> wrote:
> Hi,
>
> A method of the Java API that I am using in my project requires
> java.lang.Integer to be passed as an argument. As Inline::Java converts
> java.lang.Integer into Perl SCALAR, API is throwing
> IllegalArgumentException.
>
> Is there a way, where in I can pass java.lan.Integer object as is,
> Inline::Java not converting it into Perl SCALAR ?
>
> Appreciate your time and help in this regard.
>
> my $perlInteger = 10;
> my $value = new java::lang::Integer($perlInteger);
> print $value;
> The outout of the above program will be 10.
>
> But I want something like "main::java::lang::Integer:HASH(<some address>" to
> be printed.
>
> Thanks & Regards
> Siva
>



-- 
=====================
Patrick LeBoutillier
Rosemère, Québec, Canada

Reply via email to