Java 基础面试题设计(可以绝杀90%的开发人员)---powerdbywy

xiaoxiao2021-02-28  159

private long time = System.currentTimeMillis(); private String mMonth; mMonth = MyDateUtil.changeM(time); int i = Integer.parseInt(mMonth); if (i == (1 | 3 | 5 | 7 | 8 | 10 | 12)) { mDay = 31; } else { mDay = 30; } Log.e("1", "run:--------->mDay : "+ mDay ); public class MyDateUtil { public static String change(long mHaomiao) { // HH:mm:ss DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = new Date(mHaomiao); String mS = formatter.format(date); return mS; } public static String changeYMD(long mHaomiao) { // HH:mm:ss DateFormat formatter = new SimpleDateFormat("yyyy/MM/dd"); Date date = new Date(mHaomiao); String mS = formatter.format(date); return mS; } public static String changeM(long mHaomiao) { // HH:mm:ss DateFormat formatter = new SimpleDateFormat("MM"); Date date = new Date(mHaomiao); String mS = formatter.format(date); return mS; } public static String changeD(long mHaomiao) { // HH:mm:ss DateFormat formatter = new SimpleDateFormat("dd"); Date date = new Date(mHaomiao); String mS = formatter.format(date); return mS; } public static String changeH(long mHaomiao) { // HH:mm:ss DateFormat formatter = new SimpleDateFormat("HH"); Date date = new Date(mHaomiao); String mS = formatter.format(date); return mS; } }

请问log输出是?简述分析过程也可

转载请注明原文地址: https://www.6miu.com/read-23924.html

最新回复(0)