Hi,
I came across this line in Khalid Mughal's book and I don't understand it.
"However, note that a static method in a class can always use a reference of the class's type to access its members, regardless of whether these members are static or not."
Please consider the foll. code.
class
Test {
int no;
public static void main(
String args[]) {
Test a;
a.no = 10;
}
}
Shouldn't a.no=10 work as I'm using reference of class type (a) to access its non static member (no).
Can someone please clarify this for me...
Thanks