currently I am randomly generating a set of number from 0 to 7 in decimal in array..then I hav to convert them in binary form... however,i fail to get it.. any mistake i did?hope to get
some advises from u ..

public class Initializationtest {

         public static void main(String[] args){

                  int[][] popsize = new int[20][19];
                           for(int i =0 ; i <popsize.length; i++){
                                  for(int j =0 ; j <popsize[i].length; j++){
                                   popsize[i][j] = (int)(Math.random()*8);

                          System.out.print(Integer.parseInt("popsize[i][j]",2));
                                      } 
                          System.out.println();
                }

            }

}

Hi seang85,
I don't want to do your homework but here is where going wrong .

System.out.print(Integer.parseInt("popsize[j]",2));

There is a build in function to ease your work .Try to find it .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.