Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write the method containsT(String [] words). This method should return true in the case that a word in the array contains the letter t. The
- Write the method containsT(String [] words). This method should return true in the case that a word in the array contains the letter "t". The method should return false in the case that none of the words contain the letter "t". Consider using the method indexOf from the Java Quick reference sheet :)
You may assume that words is not null (that it has at least one value in it).
Ex) String [] wds = {"bird", "dog", "cat"};
System.out.println(containsT(wds));//prints true
String [] wds2 = {"bird", "dog", "car", "cookie", "spinach"};
System.out.println(containsT(wds2));//prints false
public static boolean containsT(String [] words)
{
}
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