can anyone suggest me how to implement print method?
regarding print method?
Under discussion
Comments (5)
- Popular
- New
- Old
You must be signed in to leave a comment
parthasarathy t s
25 May 2019, 08:01
use for loop condision
here the answer
for(int r=1;r<5;r++)
system.out.println(s);
0
Masibulele Shaun Falo
14 May 2019, 06:00
Thanks dude, I got it! :)
0
Masibulele Shaun Falo
14 May 2019, 05:57
Guys, I don't know how many attempts I have made on task 1 (level 2). I just don't seem to get it. Can some one please help? This after making all the suggested recommendations below.
0
Rhythem Parashar
14 May 2019, 05:32
The aim of having a print method is to display a string four times.
So either you can use four individual print statements
or you can implement the same using a loop
This loop will execute the print statement four times.
Here println is used instead of print as each time string has to be displayed on the new line.
+1
Tom
9 May 2019, 12:24
If you remember from the previous modules/tasks you print to the console using System.out.println() or print().
The main method here is not allowed to call that function so you'll need to add this to the method called print(). It's asking to print four lots of the String s so add four lines whilst passing in the value of s.
Hope this helps!
0