Question: create a sample program of your liking that demonstrates the use of the String class, and 3 different methods. For example; here is some code

create a sample program of your liking that demonstrates the use of the String class, and 3 different methods.

For example; here is some code that demonstrates a method, contains()

// the following code will demonstrate the use of the contains method, in the String class

String s1 = "Mississippi";

System.out.println(s1.contains("iss")); // this should return (and display) True because the string s1 does contain "iss"

System.out.println(s1.contains("xxx")); // this should return (display) False because the string s1 does not contain "xxx"

You are to write an entire program, name it what you wish, and submit it here. When run, it will demo 3 different methods of the string class (please do not use the method contains, as I did that one) Don't forget to comment and indent your code correctly!

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!