• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

OOPS Question for all?Reply immediately

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?

 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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".
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
There’s no place like 127.0.0.1. But I'll always remember this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic