How To make Geltungsbereich der variable Global(Ohne dass es eigentlich Global)

Wie kann ich Rahmen einer String-Variablen(In Java) global.So, dass es von einem anderen aus zugreifen-Funktion
ZB

//String b="null"; I don't want to do this... because if i do this, fun2 will print Null

    public int func1(String s)
    {

    String b=s;

    }

    public int func2(String q)
    {

    System.out.println(b);//b should be accessed here and should print value of s

    }

Jede Hilfe... Danke

InformationsquelleAutor user841852 | 2011-09-29
Schreibe einen Kommentar