+ 1

Error when used in different editor

/*when i search for iteration,i found this code and execute it in the editor given on the website. but when i execute it in the editor of sololearn while substituting the 'yuhu' with '00' there is an error. /*Uncaught SyntaxError: Unexpected token class Line: 1 */ /* does this mean different editor has different output?*/ public class Main { public static void main(String[] args) { int i; for (i = 0; i < 5; i++) { if (i >= 2) { break;

30th Jan 2018, 4:37 AM
Ragon
16 Réponses
+ 14
@Ace sir thats what i was asking you ... that how he is using java in js //i started learning javascript after seeing java in it //see my recent activity 😂🔫
30th Jan 2018, 5:01 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 12
no problem ☺
30th Jan 2018, 5:04 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 3
I didnt know dat! i feel like an idiot now lol. So i have to learn to use java syntax first? Thanks for the help @Guarav and @Ace :)
30th Jan 2018, 4:55 AM
Ragon
+ 3
yea sorry...im still learning haha.
30th Jan 2018, 4:57 AM
Ragon
+ 2
Sorry i forgot about the sharing option :P..here you go https://code.sololearn.com/WRyeByv6Yz4c
30th Jan 2018, 4:44 AM
Ragon
+ 2
so theres no way of iterating in javasyntax? i dont really know how...
30th Jan 2018, 5:09 AM
Ragon
+ 1
@ Ragon ...there is iteration in the code above.
30th Jan 2018, 5:55 AM
Tim Millar
Tim Millar - avatar
+ 1
@Tim_Millar but thats for javascript, not java syntax or so i was told :)
30th Jan 2018, 6:09 AM
Ragon
+ 1
@ Ragon ..... it is java
30th Jan 2018, 6:30 AM
Tim Millar
Tim Millar - avatar
+ 1
yes @ Ragon
30th Jan 2018, 6:34 AM
Tim Millar
Tim Millar - avatar
0
okay i'm lost and confused now. Does that mean it works for java syntax...? -(0.0III)- @Tim
30th Jan 2018, 6:33 AM
Ragon
0
But...but i tried and it didnt work. I set the editor to html/css/js and it didnt work for js. @Tim @Ace which is the right one..
30th Jan 2018, 6:36 AM
Ragon