Require some help
I am working on a program to roll a set of dice 1000 times and count the occurences of the doubles. I am also required to count the occurences of each of the doubles but I am getting an error on compile my code is:
publicclass TestDice
{
publicstaticvoid p(String s)
{
System.out.print(s);
}
publicstaticvoid main(String[] args)
{
PairOfDice dice;
int noRolls,doubles=0;
int bin1=0;
dice =new PairOfDice();
p("\n\n");
for (noRolls=0; noRolls<100; noRolls++)
{
dice.roll();
p("" + dice.getDice1() +"," + dice.getDice2() +"\t");
if(dice.getDice1() == dice.getDice2())
doubles++;
if(dice.getDice1() && dice.getDice2() == 1)
bin1++;
}
p("\n\nThere was " + doubles +" Doubles \n\n");
p("\n\nThere was " + bin1 +" Double 1's \n\n");
}
}
and the compliler error is:
Compiler Output
TestDice.java:28: operator && cannot be applied to int,boolean
if(dice.getDice1() && dice.getDice2() == 1)
^
1 error
--
any help on this would be truly appreciated

