Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

*Error *:: type Queue does not take parameter ?

843785Jan 8 2009 — edited Jan 8 2009
Error
type Queue does not take parameter

public  static  Queue<Integer> que =new LinkedList<Integer>() ;

public static int make(int x,int y ,int cx,int cy)
        {
		  
		   while(!que.isEmpty())
			{
			 que.add(x);
			 que.add(y);
			 int xx=que.remove() ;
			 int yy=que.remove(); 
			 mat[xx][yy]=0 ;
	         int Nxtmove = mat[x][y]+1 ;
			 
			 for(int i=0;i<8;i++)
			  {
			    if(x+dx<=C && x+dy[i]<=R && mat[x+dx[i]][y+dy[i]]==inf)
{
mat[x+dx[i]][y+dy[i]]=Nxtmove ;
que.add(x+dx[i]);
que.add(y+dy[i]);
}
}
}
return mat[cx][cy] ;
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 5 2009
Added on Jan 8 2009
8 comments
1,465 views