[Solved] How to access a string in a void method from another void method? [closed]
You need to pass it as a parameter or create a “global variable” IE you could do either of the following… public void methodOne(String string){ System.out.println(string); } public void methodTwo(){ String string = “This string will be printed by methodOne”; methodOne(string); } OR (a better solution) Create a global variable under the class declaration… public … Read more