have you tried running the above program, i don't think the program will run, below is the executable code:
import java.util.Scanner;
import java.util.Random;
class Die {
private int NumberOfSides;
public Die(){
NumberOfSides=6;
}
public int getNumberOfSides(){
return NumberOfSides;
}
}
public class dieRoll{
public static void main(String[] args) {
Die dieObject=new Die();
System.out.println(dieObject.getNumberOfSides());
}
}
Save the file with dieRoll name, compile it and run it.
But , i cannot see the roll method in it, you should probably right a roll method and and dieObject.rollmehtod which will return the random number between 1 to 6.
Regards,
panduranga.