+ 1
public static void main(String[] args) : Give attention to thise line I think what you write (args[] to ar[]). Write in place of ar[] =args[]
22nd Aug 2021, 7:23 AM
Adarsh Rajput
Adarsh Rajput - avatar
+ 1
Generally, "Cannot find symbol" is a compilation error. Based on a bad quality screenshot, you can't really expect people to diagnose / debug your code, but at first sight it looks OK. I think the error might be related to your IDE (BlueJ) but I am not familiar with it. I suggest the same things as others suggested: - copy your code into Sololearn playground to confirm that it works, or even you can try compile and run it from command line, without relying on your IDE, using javac and java commands. - review the signature of your main function, I suspect that could cause some confusion for your IDE. Generally we write the argument of main function as: String[] args rather than String args[] From language syntax standpoint, it makes no difference, but it might confuse BlueJ if it expects a String argument, rather than an array. https://stackoverflow.com/questions/25706216/what-does-a-cannot-find-symbol-or-cannot-resolve-symbol-error-mean
22nd Aug 2021, 7:49 AM
Tibor Santa
Tibor Santa - avatar
+ 1
Int k=0; Is unreachable statement ha .
22nd Aug 2021, 7:53 AM
Adarsh Rajput
Adarsh Rajput - avatar
0
It's working fine for me and produces the output: 49 Number of primes out of range:-2
24th Aug 2021, 2:52 AM
Rishi
Rishi - avatar
0
⠀⠀⠀ well, uhh, I guess it's because of some configuration problem with your compiler. It makes sense because you said that it worked fine before some months. Just out of curiosity, I see many people with empty name in sololearn nowadays, How do manage to use an empty string in place of your user name?
24th Aug 2021, 5:01 AM
Rishi
Rishi - avatar