Time.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace _7._8实战演练_Time类
{
class Time
{
//下面为私有成员//
private int hour; //私有变量
private int minunt; //私有变量
private int second; //私有变量
private void SetTime(int h, int m, int s) //私有函数,用来设置时间
{
Hour = h;
Minunt = m;
Second = s;
}
//以下为公有成员//
//构造函数,无参数
public Time()
{
SetTime(0,0,0);
}
//构造函数,一个参数
public Time(int hourValue)
{
SetTime(hourValue, 0, 0);
}
//构造函数,三个参数
public Time(int hourValue,int minuntValue, int secondValue)
{
SetTime(hourValue, minuntV