why the following things cannot be :

1.why i cannot extend the non static variable from static method or something ?

2.why i cannot use a variable directly in the class as :

class abc{
int i=4;

}
class xyz extends abc{
int j=7;
i=9;
/*this should be valid acc. to me bcz i think that when a class is extended then the
variable are also inherited and now the class xyz has i and j both accesible so it should be able to change the variable value also. */
}

3. How i can make such a program that would continously generate objects and keep on extending classes automatically and gets up all the memory of the system until the system crashes.

tell me also something more about these object concept tricks and tips...PLEZ

Recommended Answers

All 3 Replies

Please at least let people know that you are cross-posting.

Please at least let people know that you are cross-posting.

i didn't do that intentionally, i don't know from where to delete the posts

No? Which site did you accidentally log into and post this question?

commented: :) +11
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.