Unusual “static” method declaration

后端 未结 3 1970
感动是毒
感动是毒 2021-01-18 14:17
public class Card {

    public enum Rank { DEUCE, THREE, FOUR, FIVE, SIX,
        SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACE }

    public enum Suit { CLUBS, D         


        
3条回答
  •  暖寄归人
    2021-01-18 15:09

    It is also good to know initialization order, as I remember first in this order comes static variables, than static block. Also important point is time when this static block executes - at the first mention of corresponding class, not at the class instance creation.

提交回复
热议问题