Create your own version of the String class. Call it MyString. This class should be immutable. Make sure to encapsulate your data properly. Provide an implementation for the following methods:

public MyString(char[] chars);
public char charAt(int index);
public int length();
public MyString substring(int begin, int end);
public MyString toLowerCase();
public MyString toUpperCase();
public boolean equals(MyString s);
public MyString getMyString();
public String toString();
public static MyString valueOf(int i);

Do not use any function from the String class. The only time you're allowed to use the String class is in the toString() method. Even then, you may only use the String's constructor, but not the methods.

Make sure to provide a driver class, too, and show the output.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.