Assignment like String
<p>I recently went for a Java Interview where the interviewer asked me a question I could not answer. He asked me how I'd create a class whose instances can be assigned to a String, just like a string. Allow me to explain:</p>

<p>Say I create a class, MyClass and I create an object of it, say obj. The assignment should be such that:</p>

<pre><code>MyClass obj = "my Text";
</code></pre>

<p>I searched for this sort of thing but could not get any precise answers.</p>
