1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| 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 {
}
|