Accessing boolean Values of another values in one class.

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Mar 2008
Posts: 22
Reputation: a_iyer20 is an unknown quantity at this point 
Solved Threads: 0
a_iyer20 a_iyer20 is offline Offline
Newbie Poster

Accessing boolean Values of another values in one class.

 
0
  #1
Apr 15th, 2008
Hi All,
I have 2 classes. say Class A and Class B. My logic is coded in a method in class B. I am accessing this method of class B by creating an instance of class B in class A.

To explain better:
Class A{

ClassB b = new ClassB();
b.parse();
}

Class B{

parse(){
// some logic code.
}

At the end of processing the logic in parse() of Class B, I wish to set a boolean flag in Class B. such that after parse() returns what it has to, I will check the flag value and process some stuff in Class A. How can I design my solution? I tried using a static flg value in Class B. But this will not hold good in my case, because there are concurrent users to sign in to my application. Please guide and help.

Thanks,
Ashok.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 16
Reputation: striker3344 is an unknown quantity at this point 
Solved Threads: 2
striker3344 striker3344 is offline Offline
Newbie Poster

Re: Accessing boolean Values of another values in one class.

 
0
  #2
Apr 15th, 2008
i'll give you these hints, create a boolean variable in class B, make it private and use accessors/mutators to access and change that variable... now you need to learn how to use accessors and mutators> GooD Luck
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 22
Reputation: a_iyer20 is an unknown quantity at this point 
Solved Threads: 0
a_iyer20 a_iyer20 is offline Offline
Newbie Poster

Re: Accessing boolean Values of another values in one class.

 
0
  #3
Apr 15th, 2008
Yups done that...i hope you mean getters/ setters.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the Java Forum


Views: 534 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC