cant i clone a
string object like this below:
the compiler is giving an error like this:
stringfunctions.java:9: Can't access protected method clone in class java.lang.O
bject. java.lang.String is not a subclass of the current class.
String s4=(String)s2.clone();
^
why???
public class stringfunctions
{
public static void main(String args[])
{
String s2="bhushan";
String s4=(String)s2.clone();
System.out.println("strings are......." +s2.equals(s4));
}
}