Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.lang.*;
- public class VMaxLength {
- public static void main(String[] args) {
- boolean error = false;
- int max = 0;
- while (!error) {
- max++;
- try {
- int[] x = new int[max];
- } catch (OutOfMemoryError e) {
- error = true;
- }
- }
- System.out.println(max);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement