This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes core java Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "core java" Watch "core java" New topic
Author

core java

Korada Rajshekar
Greenhorn

Joined: Jul 21, 2011
Posts: 3
If we have a instance variable like int i=10 and for that class we have two objects if we change the value of i using first object then how can it notify to second object that the value of 'i' is changed....Without using Threads concept....just using normal objects
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

introduce a method which takes the same object as an argument. now test the argument object's instance field and perform a operation..something like below:
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Please, UseAMeaningfulSubjectLine .
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19214

I'd probably add support for PropertyChangeListener, through PropertyChangeSupport:


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: jrebel
 
subject: core java
 
Similar Threads
Doubt in UML distilled by Martin Fowler page 94
Pass by Reference in Java
why use getter setters in beans
Getting an Object based on hashcode
Objects and DAO pattern