I have just started learning programming, and as I was reading about strings, I found this piece of code:
System.out.print("Conversion from string to char array\n");
char [] stringToarray = exampleString.toCharArray();
for (char character : stringToarray) {
System.out.print(character);
}
Which I don't fully understand... what does "char character : stringToarray" do? Why can you use it inside a 'for', like that? I am confused because it is not the structure of 'for' I am used to see
Thank you very much for your attention !