package com.homework.zw; public class Clock { String hour; String minute; String second; Clock(String h,String m, String s) { hour=h; minute=m; second=s; } void show() { System.out.println("时间为:"+hour+"时"+minute+"分"+second+"秒"); } }
package com.homework.zw; public class Texttime { public static void main(String[] args) { Clock time = new Clock("12","25","33"); time.show(); Clock time1 = new Clock("05","33","52"); time1.show(); Clock time2 = new Clock("23","18","09"); time2.show(); Clock time3 = new Clock("10","35","00"); time3.show(); } }
时间: 2024-11-07 12:37:31