Need help, really
package com.codegym.task.task20.task2014;
import java.text.SimpleDateFormat;
import java.util.Date;
/*
Serializable Solution
*/
public class Solution {
public static void main(String[] args) {
System.out.println(new Solution(4));
}
private final String pattern = "dd MMMM yyyy, EEEE";
private Date currentDate;
private int temperature;
String string;
public Solution(int temperature) {
this.currentDate = new Date();
this.temperature = temperature;
string = "Today is %s, and the current temperature is %s C";
SimpleDateFormat format = new SimpleDateFormat(pattern);
this.string = String.format(string, format.format(currentDate), temperature);
}
@Override
public String toString() {
return this.string;
}
}