BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
String s = bufferedReader.readLine();
// int i;
for(int i=1; i < 11; i++;)
{
System.out.println(s+" loves me.");
}
error correction
Under discussion
Comments (5)
- Popular
- New
- Old
You must be signed in to leave a comment
J H U X
20 January 2021, 04:04
You wrote i++; <-- this semicolon is not supposed to be there. Fix that and your code will run just fine!
0
Serg
23 April 2019, 09:22
if this is all code you need to close bodies of the class and main method, i mean + 2 " } } " at the end;
or maybe simply to change veriable "s" to the veriable "name" like the conditions of the task demands
0
Coding Noob2
28 February 2019, 09:52
good day. My code is the same, but for some reason, I get this output:
Screen output from the program (System.out)
null loves me.
null loves me.
null loves me.
null loves me.
null loves me.
null loves me.
null loves me.
null loves me.
null loves me.
null loves me.
0
Faisal Ahmed
27 February 2023, 06:52
You have mentioned null String in output, Check the keyboard input string syntax
0
Khurram
15 September 2018, 14:19
there is no semi-colon after the increment condition in the for loop
0