What does this () mean in Java

There is already an answer to this question: > what the use of this() in LinkedList java2

It appears to work only when placed

this();

In the class variable area

Does anyone have the idea?

thank you.

Solution

This means that you are calling the default constructor from another constructor It must be the first declaration. If so, super () cannot be used It is rare to see it

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
分享
二维码
< <上一篇
下一篇>>