Hi all,
It seems as i'am moving forward to newer chapters i'm forgetting the previous ones

. Here's one question from Kathy & Bates. They have stated that-:
A static method of a class can't access a nonstatic (instance) method or variable of its own class. But the following program is doing the same i guess.. please clarify!!!
class Frog{
int frogSize=0;
public int getFrogSize(){
return frogSize;
}
public Frog(int s){
frogSize=s;
}
public static void main(String [] args){
Frog f=new Frog(25);
System.out.println(f.getFrogSize());
}
} here the static method
main is accessing the nonstatic method
getFrogSize of same class(
Frog)....
[ December 11, 2007: Message edited by: pranav bhatt ]
[ December 11, 2007: Message edited by: pranav bhatt ]