0

Project questions 3

Please help my coding String rev=""; for(char i:arr) rev = i+ rev; System .out println(rev); }

7th Jan 2022, 3:35 PM
S.kajiththa
3 Antworten
+ 1
Print rev only once in the end (after the loop) What is arr?
7th Jan 2022, 4:02 PM
Lisa
Lisa - avatar
+ 1
public class Program { public static void main(String[] args) { String rev = ""; char[] arr = {'a', 'b', 'c'}; for (char i:arr){ rev = Character.toString(i) + rev; } System.out.println(rev); } }
7th Jan 2022, 4:04 PM
Ralf Schoenian
Ralf Schoenian - avatar
0
Arr means array ..
7th Jan 2022, 4:41 PM
S.kajiththa