所以我得到了
public static void main(String[] args) {
System.out.println("Trying to open lock");
System.out.println("Trying ");
ComboLock numbers = new ComboLock();
int number1 = numbers.ComboLock;
`
我试图从这个类中调用 ComboLock
public class ComboLock {
private int number1, number2, number3;
private boolean locked;
public static final int SMALLEST_NUMBER = 1;
public static final int LARGEST_NUMBER = 39;
public ComboLock() {
locked = true;
Random rand = new Random();
number1 = rand.nextInt(LARGEST_NUMBER - SMALLEST_NUMBER) + SMALLEST_NUMBER;
number2 = rand.nextInt(LARGEST_NUMBER - SMALLEST_NUMBER) + SMALLEST_NUMBER;
number3 = rand.nextInt(LARGEST_NUMBER - SMALLEST_NUMBER) + SMALLEST_NUMBER;
}
我在尝试制作 number1.ComboLock(); 时遇到错误 说它找不到符号