Question: Some samples for testing instance methods: - The String class has an instance method toUppercase ( ) that returns a copy of the String with

Some samples for testing instance methods: - The String class has an instance method toUppercase() that returns a copy of the String with all characters converted to upper-case. Test that it works correctly on the string "bANana!". - The String class has an instance method length() that returns the length of a String. Test that it works correctly on a string of length 3.- The String class has an instance method boolean equalsIgnoreCase(String s) that compares a String to another, returning true iff they are identical (ignoring case). Test this method comparing the strings "bANana!" and "Banana!". To better implement the above recall that if s is a String then s.length() is the length of s. This is also true for constant strings. So "Banana".length() would return 6.

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 Programming Questions!