35 Points
in JAVA
In the Lesson Slides for this activity, we developed a method findChar for...
![subject](/tpl/images/cats/informatica.png)
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?
![ansver](/tpl/images/cats/User.png)
Answers: 2
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 21.06.2019 21:30
Felicia wants to become a head surgeon by december 2013. she designs the career milestones that she would need to complete her goal. by june 2013, she was not licensed. which best describes what she should do?
Answers: 2
![question](/tpl/images/cats/informatica.png)
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 02:00
In the context of an internet connection, llc stands for leased line connection liability limited company local loop complex local loop carrier
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 11:30
Convert 11001110(acdd notation) into decimal
Answers: 2
You know the right answer?
Questions
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)
History, 15.06.2020 23:57
![question](/tpl/images/cats/health.png)
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 15.06.2020 23:57
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 15.06.2020 23:57
![question](/tpl/images/cats/mat.png)
Mathematics, 15.06.2020 23:57
![question](/tpl/images/cats/istoriya.png)
History, 15.06.2020 23:57
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 15.06.2020 23:57
![question](/tpl/images/cats/himiya.png)
Chemistry, 15.06.2020 23:57
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/en.png)
English, 15.06.2020 23:57
![question](/tpl/images/cats/mat.png)
Mathematics, 15.06.2020 23:57
![question](/tpl/images/cats/mat.png)
Mathematics, 15.06.2020 23:57
![question](/tpl/images/cats/mat.png)
Mathematics, 15.06.2020 23:57
![question](/tpl/images/cats/mat.png)
Mathematics, 15.06.2020 23:57