Answer the question
In order to leave comments, you need to log in
How to make print("text"); displayed on the screen 4 times and each time from a new line?
/*
Implement the print method
*/
public class Solution {
public static void main(String[] args) {
print("Java is easy to learn!");
print("Java is object-oriented!");
print("Java is platform-independent!");
}
public static void print(String s) {
//write your code here
}
}
Answer the question
In order to leave comments, you need to log in
/*
Реализуем метод print
*/
public class Solution {
public static void main(String[] args) {
print("Java is easy to learn!");
print("Java is object-oriented!");
print("Java is platform-independent!");
}
public static void print(String s) {
//напишите тут ваш код
System.out.println(s);
System.out.println(s);
System.out.println(s);
System.out.println(s);
}
}
/*
Implement the print method
*/
public class Solution {
public static void main(String[] args) {
print("Java is easy to learn!");
print("Java is object-oriented!");
print("Java is platform-independent!");
}
public static void print(String s) {
For(int I = 0; I <= 4; I++) System.out.println(s);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question