Created
September 13, 2019 11:24
-
-
Save takahashi-h5/8eb62c9a2c94a1b177b02f0078f619a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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