Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 26-11-2009
Member
 
Join Date: Jun 2009
Posts: 1,205
How to check the value of boolean variable

I have a boolean with the name "Kitchen", one whose name is "House."

In a class Formula1 I have
Kitchen = false;
Room = true;

by default in the constructor. House and Kitchen inherit Room. Although now I wish to make a method

public boolean verifyAuthorization (Room s)

and in this method I would like to know the value of boolean whose name is s.getClass().getName(). Basically if I send him a kitchen, I want to check if the boolean whose name is kitchen is true or false.
Reply With Quote
  #2  
Old 26-11-2009
Member
 
Join Date: Nov 2008
Posts: 1,185
re: How to check the value of boolean variable

I think it has classes with the same name as Boolean stored in another class and the type of the class passed as parameter to a method implemented one knows where he wants to access a given boolean. In short, something twisted.

So we can help you in advising a better design, we explain the role and functioning of your application and its overall structure.
Reply With Quote
  #3  
Old 26-11-2009
Member
 
Join Date: Jun 2009
Posts: 1,205
re: How to check the value of boolean variable

Thank you for your answer, I simplified things. In fact I have a boolean whose name is a class name. So I'd like to arrive at this via a boolean string (actually via myObj.getClass().getName(). Basically if the object is an instance of Class Kitchen, I must watch the boolean whose name is Kitchen.

I have a class Room whether it is a Kitchen, or a Room, depending on the type of contract from client. In class type1 I have Kitchen = false, for example, then how do I know if he can use the kitchen? The fact is that my application is extendable so I do not know all the classes. So actually I would check if my object Room is authorized for a client with a type of contract
Reply With Quote
  #4  
Old 26-11-2009
Member
 
Join Date: Nov 2008
Posts: 996
re: How to check the value of boolean variable

What is your boolean? To say if the room is occupied for example? In this case, you create a boolean that holds in the class Room, and you can check inside. Make sure that this room is a kitchen or bedroom.

What are the basic principles of inheritance in programming?
Reply With Quote
  #5  
Old 26-11-2009
Member
 
Join Date: Jun 2009
Posts: 1,205
re: How to check the value of boolean variable

Boolean is not to say that in this particular type of contract, the user has the right to use the special room. How to know if the boolean in the kitchen typeSubscription class is a true or false by having the object name to be taken into account? I just want to know the syntax for writing

boolean b = true
String mystring = "b"

if (mystring)
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to check the value of boolean variable"
Thread Thread Starter Forum Replies Last Post
Check the temp enviroment variable Landon MS Office Support 10 19-04-2014 12:45 AM
How to check if variable exists in C# Hamlet Software Development 3 28-08-2009 07:30 PM
How do I check 'temp environment variable' in Word 07 Miltongomes MS Office Support 1 07-06-2009 09:03 PM
Outlook (or) Word Could Not Create the Work File. Check the temp environment variable diben805 MS Office Support 5 03-04-2009 02:36 AM
Check the temp environment variable nehal_serpa MS Office Support 1 19-07-2008 01:10 PM


All times are GMT +5.5. The time now is 02:41 PM.