0

I am a beginner in programming. I have a question about coding which is below.

String str = "Hello java";
String words[]=str.split(" ");
    for(String finalStr:words){
        System.out.println(finalStr);
}

I know the answer will be print each word. But I don't understand the line which is "for(String finalStr:words)" can someone explain about how its work ?

0 Answers0