Whenever i create a goblin object and call the method isNice, it always return false. But when i do System.out.println(nice) it does it randomly.
public class Goblin
{
private boolean nice;
private boolean isNice;
public Goblin()
{
// initialise instance variables
Random rand = new Random();
boolean nice = rand.nextBoolean();
}
public boolean isNice()
{
return true;
else
return false;
}
}