Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Static method data corruption

843811May 10 2002 — edited May 12 2002
public static void myMethod( String Argument)
{
int i = 0 ;

.....

}

What are the chances of data corruption in this static method?

IF there are chances of data corruption, am I corrupt in saying that chances of data corruption for argument and Variable i are same?

Where is function state stored in static method stored? What will happen to this if one thread pre-empts other?

-----------------------------------------------------------------------------------------------------------------------
public class a
{
int j;
public static void myMethod( String Argument)
{
int i = 0 ;

.....

}
}


How is integer j different from integer i? Where will JVM keep these variables ?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 9 2002
Added on May 10 2002
5 comments
474 views