Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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]

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

Students also viewed these Databases questions

Question

=+j Explain the relationship between unions and MNEs.

Answered: 1 week ago

Question

=+Have they changed the way employees view IP?

Answered: 1 week ago