Skip to content

对于私有静态final方法十分不解,往解答 #3

@attmore

Description

@attmore

在程序里看到了两个静态私有final方法,摘抄一个如下:

private static final int yearDays(int y) {
int i, sum = 348;
for (i = 0x8000; i > 0x8; i >>= 1) {
if ((lunarInfo[y - 1900] & i) != 0)
sum += 1;
}
return (sum + leapDays(y));
}

请问作者,这个方法加上final有何用意?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions