Timelimit exceeds

hello please help me


this is my code it’s working fine in my eclipse but in CB IDE it takes 5.98 s and timelimit exceeds

First of all remove private modifier before Scanner because u cant access the content in other method if you have made them private.
And use SeiveOfEratosthenes to find Primes , to get rid of TLE.