How to call a variable in another method in the same class?
method
class
public void example(){ String x=\'name\'; } public void take()
public class Test { static String x; public static void method1 { x="name"; } public static void method2 { System.out.println(+x); } }