Java checkstyle – constructor definition for wrong order

I have a course that looks like this:

public final class OrderedSetList<T extends Comparable<? super T>> implements OrderedSet<T> {

    // Constructor deFinition in wrong order checkstyle error next line
    public OrderedSetList() {      
        // Initializations
    }
}

Anyone can tell me why there is a "constructor definition in wrong order" error in my constructor?

This is a task. We have our own checkstyle configuration and do not allow any checkstyle errors

I appreciate your help

Solution

Checkstyle rule ensures that you follow the code conventions of declaration order:

It wants the constructor to be the first method

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>