package com.codegym.task.task02.task0201;
/*
Implement the print method
*/
public class Solution {
public static void main(String[] args) {
print("Java is easy to learn!");
print("Java opens many opportunities!");
call print(s)
}
public static void print(String s) {
s="Java is easy to learn!";
System.out.println("s");
System.out.println("Java opens many opportunities!");
}
}
what to do with this?
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Srividya
27 September 2018, 14:56
Hi, As per the question, it says,
>> "The main method should not call System.out.println or System.out.print."
So don't alter the MAIN.
>> But then, print method can call System.out.println.
Therefore, try to ... Pass strings from main to print method.
0
Learner
27 September 2018, 05:46
What is your question specifically?
Are you asking how to complete the task or you don't understand the task or any other specific issue?
The task asks you to print the passed string 4 times, which means, if you pass print("Java is easy to learn!"); then the print method should print the string 4 times like this:
Java is easy to learn!
Java is easy to learn!
Java is easy to learn!
Java is easy to learn!
+1