What is the difference between final, const and static variables in java with code example please `
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
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With