I have such Java object:
public class MyObject {
private Integer counter = 0;
public void increment() {
this.counter++;
}
// Getters, setters
}
In main() method i am calling method increment():
public class Main {
public static void main(String[] args) {
MyObject obj = new MyObject();
obj.increment(); // i want to call this line in python script
// do something more
}
}
Now let's image I want to pass MyObject instance in main() method to Python script which will call increment() method on passed MyObject instance. What is the eaziest way to do this?