I get the write output on screen. i called the function twice through a loop in the main function and a separate loop in the print function to get a total of 4 outputs all on separate lines but some how is still wrong. can anyone explain?
package com.codegym.task.task02.task0201;
/*
Implement the print method
*/
public class Solution {
public static void main(String[] args) {
String s1 = "Java is easy to learn!";
String s2 = "Java opens many opportunities!";
String s = s1 + " " + s2;
int count = 0;
while (count < 2){
print(s);
count++;
}
}
public static void print(String s) {
int count = 0;
while (count < 2){
System.out.println(s);
count++;
}
}
}