java 中的 final、const 和 static 变量有什么区别
What is the difference between final, const and static variables in java
java中final、const和static变量有什么区别
请附上代码示例
`
class X
{
static int s; // can be accessed as X.s without object
final int f = 7; // can't be assigned a different value
const int c; // doesn't compile
}
java中final、const和static变量有什么区别 请附上代码示例 `
class X
{
static int s; // can be accessed as X.s without object
final int f = 7; // can't be assigned a different value
const int c; // doesn't compile
}