I recently encountered this phrase:
"Class A has class member int a"
Probably obvious but this sentence just means a is an int defined in class A, right?
And another thing, for example a is defined under a method in class A. is it still
a class member?
I haven't found a clear definition of class member, I looked here:
but it wasn't very helpful.
Thank's in advance for the help
Class member is another way of calling static members.
class A {
int a; //instance variable
static int b; //class variable
public void c() {
int d; //local variable
}
}
In same docs
Fields that have the static modifier in their declaration are called static fields or class variables
Class variables are referenced by the class name itself, as in
Bicycle.numberOfBicycles
This makes it clear that they are class variables.
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