A new class is defined as follows:
public class TimeSpan {private int hours; //can be any non-negative numbersprivate int minutes; //must be in the range [0, 60)
public TimeSpan(int hours, int minutes) {this.hours = 0;this.minutes = 0;add(hours, minutes);}public void add(int hours, int minutes) { //for negativenumbers, set to 0//you are required to implement this method}public int getHours() { return hours;}public int getMinutes() { return minutes;}public String toString() {return hours + “h” + minutes + “m”; // Returns a String forthis time span such as “6h15m”.}}
Please implement the add method so hours and minutes are setproperly. For example:TimeSpan ts=new TimeSpan(0, 90);ts.getHours() should return
PayPal Gateway not configured
PayPal Gateway not configured