devxlogo

October 17, 2000

Static Methods

Question: What is the purpose of static methods in Java? Answer: Static methods can be invoked without an instance of an object. They provide the ability to execute methods in

Constructors and Member Variables

Question: After I have already declared an object, how can I call its constructor again to re-initialize its member variables? Answer: You can’t do that. C++ guarantees that for each

Object Class

Question: Every class in Java is supposed to extend the Object class by default. In case a user class extends some other class (e.g., if myclassextends yourclass), then is it