hello, I am sending some OOPs question ,Please answer to this and reply me immediately. 1)State of an object is retained by a) the attributes b) cannot be captured c) methods in object d) class variable 2)what is meant by Execution logic ?
Hi Vikram, I can only answer the first question regarding Java. The state of an object is retained by class variables. Methods provide implementation to classes, and Attributes are not applicable in Java Regards, Manfred.
Classes just sit there doing nothing until SOMETHING starts the ball rolling. In java the public static void main() method drives the application. This is where the "execution logic" goes. Here you create instances of those classes, and call methods etc. all planned to create a desired result. When you create instances, they in turn may cause stuff to happen, and actions and events can cause things to happen etc. A typical situation is where the main method does whatever it takes to create a GUI and get everything ready, then it just sits there waiting for something to happen so that it can respond to it.
"JavaRanch, where the deer and the Certified play" - David O'Meara