Java
Programming and Technical
Suppose if we have a 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?
Read Solution (Total 1)
-
- 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 - 7 years agoHelpfull: Yes(0) No(0)
Java Other Question