package com.wzl.day1; /** * @author wuzhilang * @Title: Day1 * @ProjectName questions * @Description: TODO * @date 7/15/20191:14 PM */ import java.util.ArrayList; import java.util.Calendar; import java.util.List; /** * 問題描述: 閱讀如下代碼輸出正確的答案 * import java.util.Calendar; * <p> * public class Elvis { * public static final Elvis INSTANCE = new Elvis(); * private final int beltSize; * <p> * private static final int CURRENT_YEAR = * Calendar.getInstance().get(Calendar.YEAR); * <p> * private Elvis() { * beltSize = CURRENT_YEAR - 1930; * } * <p> * public int beltSize() { * return beltSize; * } * <p> * public static void main(String[] args) { * System.out.println("Elvis wears size " + * INSTANCE.beltSize() + " belt."); * } * } * 以上程序輸出內容是? * (a) Elvis wears size 0 belt. * (b) Elvis wears size 73 belt. * (c) Elvis wears size -1930 belt. * (d) 以上答案都不對 */ public class Day1 { }
解析晚上放出java