Hours property

int get Hours
Gets or sets the hours.

Implementation

int get Hours => this.hours;
set Hours (int value)

Implementation

set Hours(int value) {
  if (value >= 0 && value < 24) {
    this.hours = value;
  } else {
    throw new ArgumentException("HourMustBeBetween0And23");
  }
}