import java.util.*; class SplitTest { public static void main(String[] args) { String[] tokens = args[0].split(args[1]); System.out.println("count " + tokens.length); for(String s : tokens) System.out.println(">" + s + "<"); } } I am getting compilation error in the for statement . Could any body explain how this for loop works.
Hello Anil, i understood the split method , example abc5xya6adf9764 suppose we are spliting based on digit then it will split in to abc,xya and adf .so it also doing same it is not considering lost 764 , it consider if any nondigits only.
coming to my doubt am not understanding the the new format of for loop .