Computers and Technology

BRAINLETS IF CORRECT!!! can someone help me make comments for this code please? not the first line tho

public int longestPrefix( String a, String b ) {
int count = 0;
int shortStringLength = 0;
if (a. length() > b. length()) shortStringLength = b. length();
else shortStringLength = a. length();
for (int i = 0; i < shortStringLength; i++) {
if (a. charAt(i) == b. charAt(i)) count ++;
else break;
}

return count;
}

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 05:10, kellysimkin6196
Read the code below. what will the computer print if the input for year_variable is 1700? if year_variable == 1776: print("your answer is correct. the declaration of independence was signed in “year_variable”.") elif year_variable < 1776: compute_variable = 1776 - year_variable. print("add “compute_variable“ years to your answer for the correct answer.") elif year_variable > 1776: compute_variable = year_variable - 1776 print("subtract “compute_variable” years from your answer for the correct answer.")
Answers: 1
image
Computers and Technology, 22.06.2019 23:20, nina1390
How can you tell if someone sent you a text message to your email instead of a email
Answers: 1
image
Computers and Technology, 23.06.2019 04:20, RandomLollipop
Which network media uses different regions of the electromagnetic spectrum to transmit signals through air? uses different regions of the electromagnetic spectrum to transmit signals through air.
Answers: 2
image
Computers and Technology, 23.06.2019 15:00, lopez7512
What is the total resistance in a circuit that contains three 60 ohm resistors connected in a series? a. 20 ohms b. 120 ohms c. 60 ohms d. 180 ohms
Answers: 2
Do you know the correct answer?
BRAINLETS IF CORRECT!!! can someone help me make comments for this code please? not the first line...

Questions in other subjects:

Konu
Mathematics, 20.10.2020 14:01