Java: thread safe class instances
<p>I have the following two classes:</p>

<pre><code>public class MyClass {

   public static void faceTheWorld(String Input){
      SafeClass sC = new SafeClass();
      sC.workWithInput(Input);
   }
}

public class SafeClass {
   public void workWithInput{String allInp)

   work with allInp...
}
</code></pre>

<p>My question is. If I call MyClass.FaceTheWorld() several times at the very same time, will it always create a new class instance of SafeClass or will it try to create the same instance called 'sC' all the time?</p>

<p>Would I need to create an array of instances instead to make avoid creating the same instance at the same time? How would this look in Java?</p>

<p>Ultimately what I'm trying to achieve is that when I call FaceTheWorld with the 'Input' it would always make sure that 'Input' is thread safe e.g. no other instances can modify/access it.</p>

<p>I make SafeClass synchronized, would that solve the problem?</p>

<p>Many thanks</p>
