loss of precession

public boolean[] fun(long max){

boolean[] primeno; 
primeno = new boolean[max];

last line of the code is giving a possible loss of precession.
How to rectify it :frowning:

There is nothing like precision loss, when using primitive types int, boolean…

Can you specify better what you want to achieve?

trying for prime generator actually!!
for n=1000000000 when i have (int max)
java.lang.OutOfMemoryError: Java heap space error
so i tried to convert it into long but the the loss of precession is occuring…

@zargus what did you try to convert to long exactly?

integer number 1.000.000.000 fits perfectly to int…

Do you realize that using new boolean[1.000.000.000] you request for 1GB of memory? Use -Xmx parameter for java program