static and final in Java

Modified variables:
static: static variables, which belong to this class
final: constants, can only be assigned once
static final: static constants, which must be initialized immediately (with the characteristics of static and final at the same time)


Modified method:
static: static method, which belongs to the
final: final method of this class, subclasses cannot override
static final: static final method (with the characteristics of static and final at the same time)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325512342&siteId=291194637