ArrayList<String> listUpperCase = new ArrayList<String>();
for (int i = 0; i < list.size(); i++) {
String s = list.get(i);
int len = s.length();
if(len%2==0){
listUpperCase.add(s+" "+s);
}
else if((len%2!=0)){
listUpperCase.add(s+" "+s+" "+s);
}
}
throw nullpointer exception even pass the requirement , any ideas ? thanks!
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Henry Yao
25 March 2020, 00:00
Many Thanks!
0
Misiu
24 March 2020, 22:29
Second if not needed. else is enough.
Show your reading instructions.
0