Question: Consider the method below. This method will return TRUE if and only if which of the following is true? public boolean check ( String str

Consider the method below. This method will return TRUE if and only if which of the following is true?
public boolean check(String str){
return str.length()>=2 && (str.charAT(1)== str.charAt(0)|| check(str.substring(1)));}
A) str contains two or more of the same character in a row
B) str ends with two or more of the same characters
C) str contains two or more of the same characters
D) str starts with two or more of the same characters
E) str.charAt(0)== str.charAt(1)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!