954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Accessing boolean Values of another values in one class.

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.

a_iyer20
Newbie Poster
22 posts since Mar 2008
Reputation Points: 10
Solved Threads: 0
 

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

striker3344
Newbie Poster
19 posts since Dec 2007
Reputation Points: 10
Solved Threads: 2
 

Yups done that...i hope you mean getters/ setters.

a_iyer20
Newbie Poster
22 posts since Mar 2008
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You