for the following code which I worked on.Now the problem is how do I access the variable string outside the for loop?Thank you.
for (String[] string: arr) {
if(string.length == 1)
{
System.out.println(string[0]);
continue;
}
for (int i = 1; i < string.length; i++) {
System.out.println(string[0] + " " + string[i]);
}
}