The Dice Class
package com.company;
import java.util.Random;
public class Die
{
private int sides;
private int result;
public int roll()
{
Random randint = new Random();
return randint.nextInt(sides) + 1;
}
public int getSides()
{
return sides;
}
public void setSides(int num_sides)
{
sides = num_sides;
}
/**
@param d Name of Dice
*/
public static void rollDie(Die d)
{
System.out.println(d.roll());
}
}
The Game Class
package com.company;
import javax.swing.JOptionPane;
public class Game
{
public String dealerRoll()
{
JOptionPane.showMessageDialog(null, "I will roll the dice now.");
String choice = JOptionPane.showInputDialog("Even or odd?");
return choice;
}
}
Main Class
package com.company;
public class Main {
public static void main(String[] args)
{
Die Dice = new Die();
dealerRoll();
}
}
IntelliJ is recognizing the Die in the main class, but not the dealerRoll. Can someone please tell me what I've done wrong? Im new to StackOverFlow sorry about the messed up formatting. I just learned classes in java but it works sometimes and sometimes it dosent. So please tell me whats wrong with the game class and the die class