• Post Reply Bookmark Topic Watch Topic
  • New Topic

OOPS Question for all?Reply immediately  RSS feed

 
vikram veera
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?

 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ravi Gupta
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Manfred Leonhardt:
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.


I think you need to be a little precise, "the state of an object is retained by instance variables" and not "class variables".
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ravi gupta:


I think you need to be a little precise, "the state of an object is retained by instance variables" and not "class variables".


Indeed. But look at the dates on the posts above. Note that you're pointing out an error made five years ago.
 
Ravi Gupta
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ernest Friedman-Hill:


Indeed. But look at the dates on the posts above. Note that you're pointing out an error made five years ago.


I do agree, but a misconception, howsoever old, is always dangerous to the beginers.
 
Ken Blair
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ravi gupta:


I do agree, but a misconception, howsoever old, is always dangerous to the beginers.


Surreal.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!