This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to change attribute value of one class from second class

 
Vishnu Sharma
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
B does not extend A, right ? You could have a public setter method in A, which sets the textfield to null.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic