java中的final,const和静态变量有什么区别



java中的final,const和静态变量有什么区别请提供代码示例`

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
}

最新更新