object.py 280 B

123456789101112131415
  1. import jni
  2. try:
  3. Integer = jni.cls("java/lang/Integer")
  4. except:
  5. print("SKIP")
  6. raise SystemExit
  7. # Create object
  8. i = Integer(42)
  9. print(i)
  10. # Call object method
  11. print(i.hashCode())
  12. # Pass object to another method
  13. System = jni.cls("java/lang/System")
  14. System.out.println(i)