Hi there!
I am really new on this and I will appreciate some help to understand some things, that may be quite basic for some of you. I hope you can help though.
In the code there are 3 print lines with different text. I always thought that when you want to declare a value for a String named s , we have to make something like this.
String s = "blablabla";
And then, we can insert the s directly into the println this way:
System.out.println (s);
In this exercise, the String s is associated magically directly with the prints :(
I dont get why or how ... So i dont see the sense of writing down
System.out.println (s); 4 times
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 is object-oriented!");
print("Java is platform-independent!");
}
public static void print(String s) {
System.out = s;
//write your code here
}
}
int