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
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