Making a concat operator to add char array to a string. Printing a reference variable of a string object
<p>So far, if I try to use the concat operator I get this error
Tester.java:14: cannot find symbol
symbol  : method concat(MyString)
location: class MyString
    System.out.println(hello.concat(goodbye)); // prints "hellogoodbye"</p>

<p>and when I try to print the "hello" object of MyString I get MyString@558ee9d6
I feel like its soo close to working..</p>

<pre><code>public class MyString

{
     private char[] charString;
     private String oneString;


      public  MyString(String string) 
      {
        this.oneString = string;


      }

//second constructor for overloading
    public MyString(char[] s) 
    {

        this.charString = s;
        this.oneString = charString.toString();
    }

//methods
    public String toString( char [] s)
    {
        return new String(s);
    }

    public char charAt(int i) {

        char [] temp = new char[oneString.length()];
        for ( int j = 0; j &lt; oneString.length() ;  j++)
        temp[j] = oneString.charAt(i);
        return temp[i];
    }

    public String concat ( char[] s)
    {
        s.toString();
        String result = oneString + s;
        return result;
    }

    public String concat ( String s)
    {
        String result = oneString + s;
        return result;
    }


}
</code></pre>

<p>public class Tester
{
public static void main (String[] args)</p>

<pre><code>    {
    MyString hello = new MyString("hello");
    System.out.println(hello);  // right now this prints MyString@558ee9d6
    System.out.println(hello.charAt(0));    // works, prints 'h'
    char[] arr = {'g','o','o','d','b','y','e' };
    MyString goodbye = new MyString(arr);
   // System.out.println(hello.concat(goodbye)); // i can't get this line to work
    System.out.println(hello.equals(goodbye)); // works, prints false
    System.out.println(hello.equals(hello));  //works, prints true
    }
    }
</code></pre>
