Constructor cannot be applied to given types?

前端 未结 3 1467
青春惊慌失措
青春惊慌失措 2021-01-13 15:50

I have the following Java code:

public class WeirdList {
    /** The empty sequence of integers. */
    /*ERROR LINE */ public static final WeirdList EMPTY =         


        
3条回答
  •  失恋的感觉
    2021-01-13 16:40

    You would need to add a no-arg constructor to WeirdList explicitly as EmptyList has a default no-arg constructor but it has no constructor in the superclass that it can call.

提交回复
热议问题