Using a variable in another method in another class — how?

Simply put, you can’t. Method-local variables only exist during the execution of the method. They can’t be accessed outside of the method at all.

Leave a Comment