package com.ttc;
public class test8 {
int j ;
public static void main(String[] args) {
// TODO Auto-generated method stub
test8 tt = new test8();
int last = 0;
byte[] b ={1,2,3,4,0,7,9,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,
0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
last = tt.LastArrays(b);
//System.out.println(last);
for(int i=0;i<=last;i++){
System.out.println("b["+i+"] ="+b[i]);
}
}
public int LastArrays(byte[] b){
//System.out.println(b.length);
for(int i=b.length-1;i>=0;i--){
if(b[i]!=0){
j = i;
break;
}
}
return j;
}
}
|