35 Points
in JAVA
In the Lesson Slides for this activity, we developed a method findChar for...
Computers and Technology, 19.11.2020 01:00 lealiastentz532542
35 Points
in JAVA
In the Lesson Slides for this activity, we developed a method findChar for figuring out if a character was in a String.
The implementation was:
public boolean findChar(String string, String key)
{
for(int index = 0; index < string. length(); index++)
{
String character = string. substring(index, index+1);
if(character. equals(key))
{
return true;
}
}
return false;
}
However, there is a much more efficient and simple algorithm that we can use to determine if a character is in a String. Using the method signature public boolean findChar(String string, String key), figure out a more efficient method with a lower exection count.
Hint: We’ve learned a couple of methods that can tell us what index a character is at - can we use those to determine if the character is in a String?
Answers: 2
Computers and Technology, 22.06.2019 04:00
When you collaborate or meet with a person or group online, it is called
Answers: 1
Computers and Technology, 22.06.2019 17:30
How do you make a lenny face? plz, brailiest to who can answer first.
Answers: 1
Computers and Technology, 22.06.2019 17:40
Gabe wants to move text from one document to another document. he should copy the text, paste the text, and open the new document highlight the text, select the cut command, move to the new document, make sure the cursor is in the correct location, and select the paste command select the save as command, navigate to the new document, and click save highlight the text, open the new document, and press ctrl and v
Answers: 1
Computers and Technology, 23.06.2019 00:30
Pl i need the answer now ! which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
Spanish, 11.11.2021 14:00
History, 11.11.2021 14:00
Biology, 11.11.2021 14:00
Arts, 11.11.2021 14:00
Mathematics, 11.11.2021 14:00
Mathematics, 11.11.2021 14:00
Mathematics, 11.11.2021 14:00
English, 11.11.2021 14:00
Biology, 11.11.2021 14:00