I want to create a boolean array of a size which the user is going to put as input.For example - The user might put a big number like 1000000000000 ; so then I have to creat
How about using a HashMap and use long keys and boolean values.
There you have several advantages.
1. You can use indexes within the range of long
2. You don't have to worry about the maximum size of item index that is used. As long as it is a long it will work
3. You don't allocate memory for the entire collection up front. Instead you will only use the memory that you need.