Question: MyStringMain: public class MyStringMain { public static void main(String[] args) { char[] MyInput = new char[50]; char[] MyInput2 = new char[50]; MyInput[0] = 'S'; MyInput[1]

 MyStringMain: public class MyStringMain { public static void main(String[] args) {

MyStringMain:

public class MyStringMain { public static void main(String[] args) { char[] MyInput = new char[50]; char[] MyInput2 = new char[50]; MyInput[0] = 'S'; MyInput[1] = 't'; MyInput[2] = 'e'; MyInput[3] = 'v'; MyInput[4] = 'e'; MyInput[5] = ' '; MyInput[6] = '#'; MyInput2[0] = 'C'; MyInput2[1] = 'o'; MyInput2[2] = 's'; MyInput2[3] = 'a'; MyInput2[4] = 'r'; MyInput2[5] = 'e'; MyInput2[6] = 's'; MyInput2[7] = '#'; MyString S1 = new MyString(MyInput); MyString S2 = new MyString(MyInput2); MyString S3 = S1.concat(S2); display(S3); } static void display(MyString S) { for(int i=0; i 

MyString:

public class MyString { public static final int MAXSIZE=50; public static final char DELIM = '#'; public MyString() { length=0; sArray = new char[MAXSIZE]; } public MyString(char[] inChars) { MyString(); while (inChars[length] != DELIM && length =length) return DELIM; else return sArray[loc]; } public MyString concat(MyString S) { MyString newS = new MyString(); for (int i=0; i  4. Write the method for your version of MyString: boolean compare To(MyString other)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!