+ 1

Find where the mistake is .

I have written a program in java but it is showing illegal start of a sentence, and askind an identifier. So pls Help me....!! public class Program { public static void main(String[] args) { { for( int i=1; i<=6; i++) } } System .out.println (); }

5th Jun 2020, 2:22 AM
Aryan Goel
Aryan Goel - avatar
6 Respuestas
0
Because you are not printing anything, try System.out.println(i) In your code you puted it empty
5th Jun 2020, 2:51 AM
TheBigOne
TheBigOne - avatar
+ 3
for(...) {
5th Jun 2020, 2:27 AM
Gordon
Gordon - avatar
+ 1
I'd say is because you have a totally mess in your brackets, for instance, that "{" before the "for" shouldn't be there, and that same for should have a open and close bracket after it. Check that out.
5th Jun 2020, 2:30 AM
TheBigOne
TheBigOne - avatar
+ 1
By the way, you tagged this question as JavaScript, hope that's a mistake because, it has nothing to do with Java, the actual code of the question
5th Jun 2020, 2:34 AM
TheBigOne
TheBigOne - avatar
0
I checked that out it said no result .Why??
5th Jun 2020, 2:45 AM
Aryan Goel
Aryan Goel - avatar
0
Thanks alot
5th Jun 2020, 3:05 AM
Aryan Goel
Aryan Goel - avatar