Java For循环根本不执行?
所以我有一个处理字节的程序。除了一个零件外,一切正常。对于循环,根本不执行Java For循环根本不执行?,java,for-loop,byte,Java,For Loop,Byte,所以我有一个处理字节的程序。除了一个零件外,一切正常。对于循环,根本不执行 这是代码…很复杂 public int getID(int slot){ int slots = 0; for(int a=0;a<b.length;a++){ if(correctslot){ //condition not shown. if(slots==slot){ System.out.println("found p
这是代码…很复杂
public int getID(int slot){
int slots = 0;
for(int a=0;a<b.length;a++){
if(correctslot){ //condition not shown.
if(slots==slot){
System.out.println("found pair");
for(int i=a;i<37;i++){
System.out.println("executing loop");
if(isID){ //condition not shown.
System.out.println("returning location");
return i+1;
}
}
}
slots++;
}
}
return 0;
}
public int getID(int槽){
int插槽=0;
对于(inta=0;aDebuga
。我认为a>=37
到correctlot&&slots==slot
什么是correctlot
和isId
?什么是b
?最好在那里放一个println,看看a
在循环的开头。b
是一个字节数组,correctlot)de>将数组中该位置的字节与我正在查找的字节进行了比较。isID的情况也是如此,它进行了比较。但是我认为变量a
是我的问题。