Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question points ) Implement a new remove method in the String class you worked on for HW 2 . The method should return a new
Question points
Implement a new remove method in the String class you worked on for HW
The method should return a new String object that represents the text you would
end up with if all occurrences of a given char were removed from the String. For
example, in the code below, answer should represent the text "bkstre" and true
should be printed the screen.
char bookstoreA bookstor
e;
char bookstoreA bookstor
e;
String bookstore new StringbookstoreA;
String bkstre new String bkstreA;
String answer bookstore.removeo;
System.out.printlnanswerequals bkstre;
In the text area below, type in your definition of the remove method. In other
words, type in the code that should replace the TODO comment. Your code
cannot call any methods. Also, like on HW you cannot make any use of Java's
built in String class in any way. This means, for example, that you cannot use on
Strings. You can declare variables of type String, but this will be our HW String
class, not Java's.
text for other methods not listed for the sake of space
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started