Блин парень походу токо учится вы его уже с головы до ног помоями окатили.....
Dum spiro spero если можно объясни не допонимаю как твоя прога работает
System.out.println(n);
System.out.println("Started at ->"+new Date());
ArrayList primes= new ArrayList();
primes.add(new Integer(3));
int i_sqrt;
int k=0;
Integer subList[]=null;
loop:for (int i=5 ; i < n ; i += 2)
{
i_sqrt=(int)Math.sqrt(i);
if (((Integer)primes.get(k)).intValue()<=(i_sqrt))
{
k++;
subList = (Integer[])primes.subList(0,k).toArray(new Integer[k]);
}
for (int j = 0; j< k ;j++)
{
if (i%(subList[j]).intValue()==0)
{
continue loop;
}
}
primes.add(new Integer(i));
}
System.out.println("Finish time ->"+new Date());
System.out.println(primes.size());
}
заранее спасибо
