Answer to Question #20031 in Java | JSP | JSF for nohra

Question #20031
57-8. Write a method that returns true if an array of Strings contains the String "Hellofalse otherwise.
1
Expert's answer
2012-12-05T10:29:51-0500

private static boolean StringsContains(){
boolean glag=false;
String [] arrayofStrings={"sadsdsd","Hellofalse
otherwise"};
for(int i=0;i<arrayofStrings.length;i++){
if(arrayofStrings[i].equals("Hellofalse otherwise")){
glag=true;
break;
}
}

return glag;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS