import java.util.*; class ThisShouldNotCompile { public static void main(String[] args) { new ArrayList() { { modCount++; // OK new ArrayList().modCount++; // not OK } }; }}
Standard input is empty
Main.java:9: error: modCount has protected access in AbstractList new ArrayList().modCount++; // not OK ^ 1 error
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!