Suppose If we have variable ' I ' in run method, If I can create one or more thread each thread will occupy a separate copy or same variable will be shared

Showing Answers 1 - 3 of 3 Answers

I we declare variable I  like  below,
volatile int I;
each thread  will occupy  a separate copy  of  variable I.

If we  declare a variable I like below,

int I;

each thread will share the same variable.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions