online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
import java.lang.reflect.Field; import java.util.ArrayList; public class Main { public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException{ ArrayList<String> l1 = new ArrayList<>(1000); for (int i = 0; i<10;i++){ l1.add(Integer.toString(i)); } l1.ensureCapacity(20); Class l1Reflection = l1.getClass(); Field[] fields = l1Reflection.getDeclaredFields(); for (Field field : fields) { System.out.println(field.getName() + ";" + field.getType()); } //========================================================== Field defaultCapacityField = l1Reflection.getDeclaredField("DEFAULT_CAPACITY"); defaultCapacityField.setAccessible(true); int defaultCapacity = defaultCapacityField.getInt(l1Reflection); System.out.println(defaultCapacity); Field maxArraySizeField = l1Reflection.getDeclaredField("MAX_ARRAY_SIZE"); maxArraySizeField.setAccessible(true); System.out.println(maxArraySizeField.getInt(l1Reflection)); /* Field sizeField = l1Reflection.getDeclaredField("size"); sizeField.setAccessible(true); System.out.println(sizeField.get(l1Reflection));*/ { Field capacityField = l1Reflection.getDeclaredField("elementData"); capacityField.setAccessible(true); int currentCapacity = ((Object[]) capacityField.get(l1Reflection)).length; System.out.println(currentCapacity); } } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue