Java - accessing private fields of enum from overridden methods

前端 未结 0 1969
说谎
说谎 2020-12-14 22:37

I was playing around with enums and I saw that this code won\'t compile:

class TrafficLight{
    enum Color{
        RED(23){
            private int y=5;
            


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题