Prev Next

Java / Variable

Is local variable thread safe in java?

Yes. All local variables defined in your program will be allocated memory in the stack. So, When you create a thread it will have its own stack created. Two threads will have two stacks and one thread never shares its stack (that is, local variables) with other thread.

❤Cash Back At Stores you Love !!!❤

Earn your $10 reward when you make your first purchase through Ebates by signing up with clicking below button.

Ebates Coupons and Cash Back

More Related questions...

Show more question and Answers...

Local Variables

Comments & Discussions