www.3112.net > 用JAvA做的 定义一个时间类型(类名MyTimE)

用JAvA做的 定义一个时间类型(类名MyTimE)

public class MyTime { private int hour; //时 private int minute; //分 private int second; //秒 public MyTime(){ } public MyTime(int hour,int minute,int second){ this.hour = hour; this.minute = minute; this.second = second; } pu...

import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; public class MyTime { public String hour; public String minute; public String seco...

你说的这么详细了,应该可以自己写出来,如果这个是你的作业,或者是练习,我建议你自己写一下,如果出现问题了再提出来,大家帮你解决问题。

public class Test { int h,m,s; public String toString() { return h+":"+m+":"+s; } public static void main(String[] args) { } public Test(int h, int m, int s) { super(); this.h = h; this.m = m; this.s = s; } public int getH() { ...

package com.mongo;import java.util.Calendar;import java.util.Date;public class Test {public static void main(String[] args) {MyTime m=new MyTime();System.err.println(m.getDate());System.err.println(m.getTime());}}class MyTime{p...

你好聪明啊 免费让人帮你写代码

package test; public class MyTime { private int hour; private int minute; private int second; public MyTime() { this.hour = 0; this.minute = 0; this.second = 0; } public MyTime(int h, int m, int s) { this.hour = h; this.minute ...

public class MyDate {private int year ;private int month ;private int day ;public MyDate(){}public MyDate(int year, int month, int day) {super();this.year = year;this.month = month;this.day = day;}public String toString() {retu...

最好放在一个包下吧! 比如:package mytime; 然后import mytime.Time;

import java.text.SimpleDateFormat; import java.util.Calendar; public class MyTime { public int hour; public int minute; public int second; public MyTime(){ Calendar cal = Calendar.getInstance(); hour = cal.get(Calendar.HOUR_OF_...

网站地图

All rights reserved Powered by www.3112.net

copyright ©right 2010-2021。
www.3112.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com