Want help with Java Labelled break error:-

int quick(int[] a,int d,int s,int st){
int loc=0;
stepx:{ while(a[loc]<=a[st] & loc!=st)
st–;
if(loc==st)
return loc;
if(a[loc]>a[st])
{
int temp=a[loc];
a[loc]=a[st];
a[st]=temp;
loc=st;
break stepy;

		}
	
		}	
	 stepy:{
		while(a[s]<=a[loc] & s!=loc)
		   s++;
		if(loc==s)
			return loc;
		if(a[loc]<a[s])
		{
			int temp=a[s];
			a[s]=a[loc];
			a[loc]=temp;
			loc=s;
			break stepx;
		    
			
		}
		
		}
	return loc;
 } 

I want to do quick short.but it is error showing in break statements: "Label stepx & stepy is misssing?
Thanks in Advance.

I do not know whether you understood properly why there are labels and how those works.

There is no goto command in Java (thankfully)…

Typicall usage of labels, I’m using when needed is

outer:
for ... // outer loop
    for ... // inner loop
        if (someCondition) break outer;

which ends also iterations in outer loop as opposite to simple break, which would end execution (do a break) of the inner loop only…