Threads can share the heap that includes class variables and instance variables. Each thread gets its own share of stack memory, which includes local variables, method parameters, and exception handler parameters. So a multithreaded application should safeguard the static and instance variables or attributes of its shared objects. Figure below shows the type of variables that are always safe in a multithreaded application. So it’s always the not-so-safe instance and static variables that you need to care about.