Question: are local variables thread safe in java?
Answer: Local variables are stored in each thread's own stack. That means that local variables are never shared between threads. so Method area and Heap is shared by all the threads but every thread is having its own JAVA Stack and PC and that is not shared by any other Threads. ... so all the local variables are THREAD SAFE.