How do i print 42 black lines

//How do I print 42 blackl lines I know I could copy paste system.out.println(); 42 times but is there better way like I want to know if I can use loops like for while

>Solution :

you can easily use for loop like this:

for (int i = 0; i < 42; i++) {
        System.out.println("black line!");

use anything you want instead of black line! text.

Leave a Reply