micropython/tests/jni/object.py

17 wiersze
281 B
Python

import jni
try:
Integer = jni.cls("java/lang/Integer")
except:
print("SKIP")
raise SystemExit
# Create object
i = Integer(42)
print(i)
# Call object method
print(i.hashCode())
# Pass object to another method
System = jni.cls("java/lang/System")
System.out.println(i)