there is my code, but null is cannot compatible to int
int a=Greenfoot.getRandomNumber(9)+1; int b=Greenfoot.getRandomNumber(9)+1; public void keluarSoal(int x,int y) { int ke; int jawabBenar = x+y; int jawabSalah = x+y+Greenfoot.getRandomNumber(3)-3; int [] pilihan = {jawabBenar, jawabSalah}; for(int i =0; i <2; i++) { ke=Greenfoot.getRandomNumber(2); if(pilihan[ke]==null) //can't compile i--; else { Label jwb = new Label(pilihan[x],25); pilihan[x]=null; } }