|
From: <php...@li...> - 2009-04-22 07:31:14
|
The tests.php5 folder from the documentation download contains lots of them.
The following can be typed on the windows or linux command shell:
echo 'public class c{public Integer[]f(Integer[]p){return p;}}'>c.java
javac c.java
jar cf c.jar c.class
jrunscript -classpath JavaBridge.jar -l php-interactive
java_require ("c.jar")
$c=new java("c")
$arOb=$c->f(array(1,2,3))
echo $arOb[2]
=>3
$lOb=java("java.util.Arrays")->asList($arOb)
echo (string) $lOb
=>[1, 2, 3]
$lOb->add(5)
=> Exception, backed by array
$ar=java_values($lOb)
print_r($ar)
Hope it helps.
Regards,
Jost Boekemeier
Apr 22, 2009 8:13 vorm. schrieb am <
php...@li...>:
Hello Jost,
would you please give an example of an array list in php-java-bridge.
Many thanks in advance!!!!
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|