Question: Write a java program named MyString. The class contains: The following three String data fields, you may use them to implement the methods. string1 =

Write a java program named MyString. The class contains:

The following three String data fields, you may use them to implement the methods.

string1 = Where there is a will, there is a way.

string2 = Programming is fun

string3 = you should work to earn it

Visit the following, https://docs.oracle.com/javase/7/docs/api/java/lang/String.html java documentation site and implement at least 5 of the methods defined within the String class.

Examples of the method you may implement must include:

1.compareTo(String anotherString)

2.concat(String str)

3.equals(Object anObject

4.replace(char oldChar, char newChar)

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!