I'm new to java so it is possible i haven't spotted something simple here but its been bugging me for hours so here goes.

I've written a class that creates an array of ones and zeros at random and then prints this in the command line (or should do).

My code:
class Genpop {
public static int[][] genpop1() {
int[][] population = new int[8][8];
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
double x = java.lang.Math.random();
if (x<0.5){
population[i][j] =1;}
return population;
public static void main(String args[]) {
int[][] pop = genpop1();

I've tried print lines to check that the random number is being generated and to make sure that the if statements are being executed but all i get when i run the program is:


not very nice

any help would be greatly appriciated