Solved

Complete the Following Code Snippet with the Correct Enhanced for Loop

Question 26

Multiple Choice

Complete the following code snippet with the correct enhanced for loop so it iterates over the array without using an index variable. String[] arr = { "abc", "def", "ghi", "jkl" };
___________________
{
System.out.print(str) ;
}


A) for (String str : arr)
B) for (str : String arr)
C) for (str[] : arr)
D) for (arr[] : str)

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions