public class Solution {
public static void main(String[] args) {
//write your code here
String s = print();
System.out.println(s);
}
public static String print() {
String text = ("I want a big salary, and that's why I'm studying Java");
for (int i = 0; i <= 10; i++) {
}
return text;
}
}
Why can i not get it to print the line 10x? It only prints line once...
Resolved
Comments (6)
- Popular
- New
- Old
You must be signed in to leave a comment
sarthak pawar
30 April 2020, 07:10
write the return text in the for loop block
0
Mukul Chauhan
28 May 2019, 16:08
public class Solution {
public static void main(String[] args) {
//write your code here
for(int i = 0 ; i < 10 ; i++ )
{
System.out.println("I want a big salary, and that's why I'm studying Java");
}
}
}
0
smile
26 May 2019, 23:34solution
I don't know if a string can equal to a method, and I think there is also a print() method in Java. Maybe it can be confusing, so I create a print10() method...
+3
romeo
26 May 2019, 23:57
Youre right... I'm retarded
0
Azja
26 May 2019, 19:35
Change
to
because you got 11 lines not 10 0
romeo
26 May 2019, 23:03
But the the code only prints the line once.
0