File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed
docs/dataStructures-algorithms Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -135,17 +135,21 @@ public class Main {
135135
136136 }
137137
138- private static boolean checkStrs (String [] strs ) {
139- if (strs != null ) {
140- // 遍历strs检查元素值
141- for (int i = 0 ; i < strs. length; i++ ) {
142- if (strs[i] == null || strs[i]. length() == 0 ) {
143- return false ;
144- }
145- }
146- }
147- return true ;
148- }
138+ private static boolean chechStrs (String [] strs ) {
139+ boolean flag = false ;
140+ if (strs != null ) {
141+ // 遍历strs检查元素值
142+ for (int i = 0 ; i < strs. length; i++ ) {
143+ if (strs[i] != null && strs[i]. length() != 0 ) {
144+ flag = true ;
145+ } else {
146+ flag = false ;
147+ break ;
148+ }
149+ }
150+ }
151+ return flag;
152+ }
149153
150154 // 测试
151155 public static void main (String [] args ) {
You can’t perform that action at this time.
0 commit comments