R
R
Roxanna Kosheleva2020-05-18 22:04:53
Java
Roxanna Kosheleva, 2020-05-18 22:04:53

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

2 answer(s)
R
runapa, 2020-05-18
@FoxAnn

/*
Реализуем метод 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);
}
}

B
BRO_PROGRAMIST, 2020-05-19
@BRO_PROGRAMIST

/*
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 question

Ask a Question

731 491 924 answers to any question