circuitpython/tests/jni/object.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
281 B
Python
Raw Permalink Normal View History

import jni
2021-03-15 09:57:36 -04:00
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)