Difference or no difference

class Test

{

publicstaticvoid main(String args[])

{

int i=0, j=0;

X1:for(i = 0; i < 3; i++)

{

X2:for(j = 3; j > 0; j--)

{

if(i < j)continue X1;

elsebreak X2;

}

}

System.out.println(i+" "+j);

}

}

I understand the differences between continue and break (or at least hope I do), but want to make sure if I am right in thinking that in the above code there is actually no difference between the usage of the continue or break statements?

What I mean is - they both achieve the same end don't they?

[1215 byte] By [hockeygod76a] at [2007-11-27 6:28:58]
# 1
Break will loop out of the entire (even nested) loops. Continue will get out of the 'looplet'
Jamwaa at 2007-7-12 17:52:43 > top of Java-index,Java Essentials,New To Java...
# 2
More information is here: http://java.sun.com/docs/books/tutorial/java/nutsandbolts/branch.html
Jamwaa at 2007-7-12 17:52:43 > top of Java-index,Java Essentials,New To Java...
# 3

> Break will loop out of the entire (even nested)

> loops. Continue will get out of the 'looplet'

X1: for(i = 0; i < 3; i++)

{

X2: for(j = 3; j > 0; j--)

{

if(i < j) continue X1;

else break X2;

}

}

But in this example don't they achieve the same result?

hockeygod76a at 2007-7-12 17:52:43 > top of Java-index,Java Essentials,New To Java...