Skip to content

Instantly share code, notes, and snippets.

@takahashi-h5
Created September 13, 2019 11:24
Show Gist options
  • Save takahashi-h5/8eb62c9a2c94a1b177b02f0078f619a4 to your computer and use it in GitHub Desktop.
Save takahashi-h5/8eb62c9a2c94a1b177b02f0078f619a4 to your computer and use it in GitHub Desktop.
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void main(String[] args) {
@SuppressWarnings("serial")
List<String> list = new ArrayList<String>() {
{
get(2); // IndexOutOfBoundsExceptionが発生する
add("test1");
add("test2");
add("test3");
}
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment