Linked Questions

7 votes
6 answers
72k views

I wish to enter one int and another long ex: 1 and 1000000000, and now I wish to create an array of size 1000000000. And then at each index of array, store int val, ex: arr[100000000] = 4. When I'...
ranaarjun's user avatar
  • 255
0 votes
1 answer
7k views

I was doing boundary check of a 2D array which is array[8][LIMIT]; Then I tried several times and found the LIMIT variable should not be larger than 89489404, otherwise there will be an exception like ...
Zip's user avatar
  • 859
0 votes
1 answer
423 views

How many integers can an array in java and python have? And if I want to enter more integers to an array and I reached that limit how to handle this?
Ahmed Sami's user avatar
-1 votes
1 answer
258 views

When using command line arguments in java I am curious to how big is the args array parameter in main. And if it is varied length how does main know the length?
Anthony Mullen's user avatar
0 votes
0 answers
186 views

I'm trying to calculate all prime numbers of given a limit using the sieve of eratosthenes method. I know how to do that with big numbers as limit, but what if I try a real big number, larger than ...
Roger_88's user avatar
  • 477
-1 votes
2 answers
89 views

when i working on java ,i tried to create an array of Node class . For specifying size i used int before,it worked fine but when i changed to long it is giving me compilation error. plz check the code ...
spa's user avatar
  • 359
-2 votes
1 answer
131 views

class lab1{ public static void main(String[] args){ int arr[]= new int[2147483647]; System.out.println(arr.length); } }
Black Diamond's user avatar
-1 votes
2 answers
131 views

I am wondering how to instantiate a long[] array in Java with the greatest possible length. If it is too big, I get a memory error. I need this array to be as big as possible without exceeding the ...
Daniel Williams's user avatar
0 votes
0 answers
89 views

I was trying to create a int[] type array in Java with a user input based length. Below is the code for the same : int[] change = new int[max+1]; When the value of max = 2147483647, the compiler ...
Aditya Sharma's user avatar
-1 votes
2 answers
74 views

I am trying the following code String[] buffer = new String[1447891223]; Arrays.fill(buffer, "0.0"); The above code gives me java.lang.OutOfMemoryError: Java heap space Is there any way i could do ...
Pri_stack's user avatar
  • 189
0 votes
0 answers
25 views

Long in Java has size 2^63-1. But if I write a code like this, my IDE says Incompatible types: required int but found long. long [] array = new long[4_000_000_000L]; What is the problem here?
JohnWinter's user avatar
  • 1,033
181 votes
4 answers
122k views

What are the use cases when a particular sorting algorithm is preferred over others - merge sort vs QuickSort vs heapsort vs 'intro sort', etc? Is there a recommended guide in using them based on the ...
sam's user avatar
  • 1,847
47 votes
12 answers
48k views

Is it possible to have same hashcode for different strings using java's hashcode function?or if it is possible then what is the % of its possibility?
Xara's user avatar
  • 9,178
24 votes
11 answers
19k views

I have a big file, it's expected to be around 12 GB. I want to load it all into memory on a beefy 64-bit machine with 16 GB RAM, but I think Java does not support byte arrays that big: File f = new ...
Omry Yadan's user avatar
  • 34.1k
10 votes
15 answers
42k views

I'm trying to find a counterexample to the Pólya Conjecture which will be somewhere in the 900 millions. I'm using a very efficient algorithm that doesn't even require any factorization (similar to a ...
user avatar

15 30 50 per page
1
2 3 4 5
7