1. getStringTime in Calendar
1 2 3 4 5 6 7 8 |
public String getStringTime() { Calendar calendar = Calendar.getInstance(); Date date = new Date(); calendar.setTime(date); return calendar.get(Calendar.HOUR_OF_DAY)+":" +calendar.get(Calendar.MINUTE)+":" +calendar.get(Calendar.MILLISECOND); } |
2.debug
1 2 3 4 |
//No need to type many System.out.println... public void debug(String str){ System.out.println("debug: " + str); } |