dcsimg
Passing the static variable value from one application to other
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   anurag_gupta
Posted On:   Tuesday, July 23, 2002 06:13 AM

I have two application in which i am creating the object of a javabean . in this java bean class i have defined a static variable. in one of my application i changed the value of this static variable. and i have checked the value (after change) of this static variable in other application (which have the object of this bean) but there is no change in this static variables value why. first one is public class p1 { static int bb=36; public static void main(String arg[]) { } public void call(){ System.out.println("bb == "+b   More>>


I have two application in which i am creating the object of
a javabean . in this java bean class i have defined a
static variable. in one of my application i changed the value of this static variable. and i have checked the value (after change) of this static variable in other application (which have the object of this bean) but there is no change in this static variables value why.


first one is



public class p1


{


static int bb=36;


public static void main(String arg[])


{


}


public void call(){

System.out.println("bb == "+bb);
}


}






second one is




public class p2{

static public void main(String arg[])

{

System.out.println(" before bb == "+p1.bb);

p1 po= new p1();

po.call();

p1.bb=98;

po.call();

System.out.println("after bb == "+p1.bb);

}

}

   <<Less

Re: Passing the static variable value from one application to other

Posted By:   Ivo_Limmen  
Posted On:   Tuesday, July 23, 2002 06:30 AM

Weird, this is my output (using JDK 1.3.1):

before bb == 36
bb == 36
bb == 98
after bb == 98

I didn't change anything of your I believe... try a recompile...
About | Sitemap | Contact