Hello Jonas,
not directly. What you can do:
Option 1: You can pass an object containing a variable. Within the method you can access and modify the variable. For this application case you implement a new class containing one or more variables. Then you create an instance of the class and pass it in the method invocation. To improve performance you can reuse one and the same object avoiding so its recreation.
Option 2: Another possibility involves property references. In this case the value of interest is stored within a property. When invoking the method you pass a reference to the property. Within the method you can derefence the passed reference and so access and modify the property.
Both approaches are very similar to how pointers work in C. However, the support limits to objects and properties. Pointers pointing directly to variables or arrays are not supported.
I hope it helps you further.
Best regards
Paul Banach