strcpy in java :(
<p>I have an algorithm that reads from the stdout into a string variable called 'name' and then creates a string array that stores the name..I tried to do this in java but first, I don't know how to pass the name into the array. in C or C++, i could have just easily done this : strcpy(arr, name); but these are string types and there are no c_str() equivalent in Java that I have seen. Please, how do I do this?</p>

<pre><code>      .... //codes are here...
      System.out.Println("enter your name and press enter:");
      BufferedReader br = new BufferedReader(InputStreamReader(System.in));
      String name = null;
  try
    {
      name = br.readLine();
      String[] arr = new String[name.length];
       //wish this was C++;
        strcpy(arr.c_str(), name.c_str()); //how do you copy the name string to the arr   
                                           //string?

  }catch(IOException e)
     {
      System.out.Println(e.getMessage());
    }

    MyClass A = new MyClass(arr);
</code></pre>
