Win a copy of Learning Regular Expressions this week in the General Computing forum!
    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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

help please...  RSS feed

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Report post to moderator
This may sound easy to you that's why I need your help. How do I use a string value from one class to another class?

Example: I have a string in class A and I want to use it for a decision in class B. How do I do that? Will you help me?

Thanks.
 
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Report post to moderator
One way would be to make a public method to retrieve the string from class A. For example, say this simple class which represents a person was your 'A' class:


Then in your 'B' class you would call the getName() method to find out the value of the name variable. Something like this:

[ June 10, 2005: Message edited by: Stuart Gray ]
 
author and iconoclast
Sheriff
Posts: 24220
40
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Dupe. See Here.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!