java面线对象练习时钟
package com.text_1; public class Clock { int h,m,miao; Clock(int xiaoshi,int fenzhong,int mia) { h=xiaoshi; m=fenzhong; miao=mia; } void show() { System.out.println("现在时间是"+h+":"+m+":"+miao); } public static void main(String[] args) { // TODO 自动生成的方法存根 Clock shizhong=new Clock(12,28,56); shizhong.show(); } }