package com.hanqi.test; public class Clock {
int hh;
int mm;
int ss;
String time;
Clock(int h,int m,int s)
{
hh=h;
mm=m;
ss=s;
time=hh+"时"+mm+"分"+ss+"秒";
}
String show()
{
return time;
}
}
package com.hanqi.test; public class Test06 { public static void main(String[] args) {
Clock ck=new Clock(12,30,45);
System.out.println("当前时钟时间是:"+ck.show()); } }