+ 5
Does anyone have a fix for this for loop problem using char?
I'm trying to loop these 2 symbols "/_" and keep getting a playground error 😳 https://code.sololearn.com/cCq7MwFacw8n/?ref=app
2 ответов
+ 4
public class Program
{
public static void main(String[] args) {
String s;
s = new String("/_");
char c = s.charAt(0);
char ch = s.charAt(1);
for(int i = 0; i<10; ++i){
System.out.println(c); // You wrote print
System.out.println(ch); // You wrote print
}
}
}
+ 1
thanks but its not what i want i need it on the same line using "print"