wood burning stoves*
The moose likes Beginning Java and the fly likes How to change attribute value of one class from second class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to change attribute value of one class from second class" Watch "How to change attribute value of one class from second class" New topic
Author

How to change attribute value of one class from second class

Vishnu Sharma
Ranch Hand

Joined: Feb 03, 2010
Posts: 55
Hi all,

I have a requirement, in which i need to do this. Let me cler by this example: I have two files, A.java & B.java, A file contains one textfield, txt. I need to set the value of txt as null, but from B file. Both of these files are in same package Miniproject of c drive.
Please suggest me the appropriate. Thanks in advance.


Regards,
Vishnu
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

B does not extend A, right ? You could have a public setter method in A, which sets the textfield to null.


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to change attribute value of one class from second class