In level 2 lesson 1 the task what way is it related to objects. how to code no headway
Condition requesting to add solution class print
Not exactly sure how that can be called - The main method should call the Solution class's print method exactly twice.
the print method should display string 4 times
In level 2 lesson 1 the task what way is it related to objects. how to code no headway
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Joe
26 May 2019, 07:33
Requirement:
In the print method, display the passed string 4 times. Each time, on a new line.
Requirements:
1. The program should display text on the screen.
2. The main method should not call System.out.println or System.out.print.
3. The print method should display the text on the screen.
4. The main method should call the Solution class's print method exactly twice.
5. The print method should display the string 4 times. Each time, on a new line.
Program:
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!");
}
public static void print(String s){
//write your code here
System.out.println(main);
}
}
0
Raivo Lapiņš
21 May 2019, 19:43
If you provide us with a code you have, we might be able to help you. It's hard to understand what you are having issue with.
0