Originally posted by James Palmer:
Could you explain how this works?
int x = (int) (Math.random() * 20);
Thanks
Originally posted by James Palmer:
erm,for some reason the only number it gives me is 0.
Originally posted by James Palmer:
could you just explain this a bit for me please?I ve given you quite a hard time but thanks a lot for your help!
Originally posted by James Palmer:
What am i doing wrong?
Originally posted by James Palmer:
...I thought by using:
public void setNumber1(int n1) {
n1 = (int) (Math.random() * 100);
number1 = n1;
}
that i had set number1 to a number but as it seems it does not happen.
Originally posted by James Palmer:
It gives me an error "cannot resolve symbol: max" .And why do i need to use that max?thanks
Originally posted by James Palmer:
i call the getNumber1() method which i thought would call the setNumber1 method to get the number itsel