import java.util.*;
class BallList{
private LinkedList<Integer> list = new LinkedList<Integer>();
public BallList(int n){
for (int i = 0; i < n; i++){
list.add(i+1);
}
}
public void DoAxy(int num1, int num2){
Iterator iterator = list.iterator();
int count = 0;
while (iterator.hasNext()){
count++;
if (iterator.next().equals(num1)){
break;
}
}
int index = count;
list.remove(num2);
list.add(index,num2);
}
public void DoBxy(int num1, int num2){
Iterator iterator = list.iterator();
int count = 0;
while (iterator.hasNext()){
count++;
if (iterator.next().equals(num1)){
break;
}
}
int index = count-1 ;
list.remove(num2);
list.add(index,num2);
}
public void DoRemove(int num){
list.remove(num);
}
public LinkedList <Integer> getList(){
return list;
}
}
class Balls2{
public static void main(String[] args){
int num_balls, num_ops;
String op;
Scanner sc = new Scanner(System.in);
num_balls = sc.nextInt();
num_ops = sc.nextInt();
BallList Arrayballs = new BallList(num_balls);
for (int i = 0; i < num_ops; i++){
op = sc.next();
if (op.equals("A")){
int ball_1 = sc.nextInt();
int ball_2 = sc.nextInt();
Arrayballs.DoAxy(ball_1, ball_2);
}
else if (op.equals("B")){
int ball_1 = sc.nextInt();
int ball_2 = sc.nextInt();
Arrayballs.DoBxy(ball_1, ball_2);
}
else{
int ball = sc.nextInt();
Arrayballs.DoRemove(ball);
}
}
}
LinkedList<Integer> listballs = Arrayballs.getList();
}
上記のコードを実行すると、次のエラーが表示されます。
Balls2.java:80: error: cannot find symbol
LinkedList<Integer> listballs = Arrayballs.getList();
^
symbol: variable Arrayballs
location: class Balls2
1 error
誰でもこれについて私を助けることができますか?