
How can i call a static variable of one class to another class.
can i change static varibale value.
//A.java
public class A
{
static JTextField p=null;
static int k;
public A()
{
}
public actionPerformed(ActionEvent ae)
{
k=Integer.parseInt(p.getText());
//Some Condition
B=new B();
public static void main()
{
}
}
//B.java
public class B { static int l=A.k; public B() { C p=new C(); } public static void main(String args[]) { } }
// //C.java
public class c {
public c() {
} public actionPerformed(Actione Event ae) { A l=new A(); } public static void main(String args[]) { } }
during first life cycle i got original values but when i called second time it shows previous value. please help me
for example if i have given k=9 for first life cycle the output also 9 but during second life cycle i have given k=18 it shows output as 9 answer me please

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.