Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/360.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java For循环根本不执行?_Java_For Loop_Byte - Fatal编程技术网

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;aDebug
a
。我认为
a>=37
correctlot&&slots==slot
什么是
correctlot
isId
?什么是
b
?最好在那里放一个println,看看
a
在循环的开头。
b
是一个字节数组,
correctlot)de>将数组中该位置的字节与我正在查找的字节进行了比较。
isID的情况也是如此,它进行了比较。但是我认为变量
a
是我的问题。