Question: In java, Open the String class in the Java API, and take a look at the different versions of the indexOf() and substring() methods, identify

In java,

Open the String class in the Java API, and take a look at the different versions of the indexOf() and substring() methods, identify what parameters each version of those methods accept and what does it return, and do the following: Create a class named MiniString, the class should have the following: - A private String instance variable named str. - A constructor that takes a String as a parameter and sets the instance variable str to the parameter String. - Create 2 methods each named makeSubstring(), and each version of makeSubstring() will implement a version of the substring() method from the Java API String class. - Create 4 methods each named findIndexOf(), and each version of findIndexOf() will implement a version of the indexOf() method from the Java API String class. - The only 3 String methods you can use to solve this problem are: charAt(), length() and equals(). - IF YOU use any other method from the String class, you will not get credit for this problem. - In this problem, you are actually re-inventing the wheel. You are implementing methods that already exist in the Java API. its really important to know how those methods work, and how to build them from scratch.

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!