Network disconnection
Description
Object 타입 원소 하나를 맨 마지막 위치에 추가하는 메소드 addLast를 만들려고합니다. 빈칸을 알맞게 채워 문제를 해결해 보세요.
Fill type challenge HOWTO
- In the Fill type challenge, you have to fill the blank with appropriate code
- The given code except the blank cannot be edited.
- An error message will be shown in the Result area when you leave the blank empty.
1
2
3
4
5
6
7
8
9
10
11
12
13
class ArrayList {
private int size = 0;
private Object[] elementData = new Object[50];
public boolean addLast(Object e)
{
// elementData의 마지막 위치에 인자 e를 추가하세요.
elementData[ ] =
// size를 1 증가시키세요.
return true;
}
}
1
2
3
4
5
6
7
8
9
public class MainRunner
{
public static void main(String[] args)
{
ArrayList arraylist = new ArrayList();
arraylist.addLast(3);
return ;
}
}
Result
Stop
Result of [Run] or [Submit] will be displayed here