Link to home
Start Free TrialLog in
Avatar of chima
chima

asked on

making a boolean variable public static

Hello,
I have made String variable public static and have worked with them.  When I attempted to make a boolean "public static" the second file did not recognize that boolean variable;
      public static String childData;
      public static boolean ACPstatus;

What's the difference?  How can I make this boolean public?
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chima
chima

ASKER

CEHJ, that is what I kept saying; There isn't any difference.  I am not at work at this time. I will do so tomorrow.  Thanks.
Avatar of chima

ASKER

The only difference is that I am trying to use it via an abstract interface.  Tomorrow I will try it outside of it.
Please publish any error messages (literally).

;JOOP!
>>The only difference is that I am trying to use it via an abstract interface.

The following should work fine too
public interface Foo {
    public final static boolean bar; // (first 3 modifiers redundant in reality)
}

Open in new window

Avatar of chima

ASKER

The doStaticTable is an abstract class; http://localhost/FitNesse.TableFixture that needs to be over written.  The code snippet below is from the first TableFixture, whereby I instantiate the second doStaticTable, i.e., ACP acp = new ACP();  It is on the second file (this file) that I define the public static boolean ACPstatus;.  When I try using it on the first file, it does not resolve to the boolean from the second file.
I hope that make sense.
thanks

	protected void doStaticTable(int rows) {        
		//Get the attribute name and create a Constraint
		//private Logger log = Logger.getLogger("alse");
		
		System.out.print("\n Before ACP");
		ACP acp = new ACP();
		acp.doStaticTable(rows);
		System.out.print("\n Between ACP " + ACPstatus);
		if(!ACPstatus) {
			System.out.print("\n IN main");
			right(0,1);
		}
		System.out.print("\n After ACP");

Open in new window

Java doesn't work on the basis of files - it works on the basis of classes. One of your classes is 'ACP' . What is the other one called?
Avatar of chima

ASKER

The other class is Network Systems.
That's not a class name. Class names can't contain spaces
Avatar of chima

ASKER

CEHJ, correction NetworkSystems
Avatar of chima

ASKER

thanks, this is not a big issue for me now.  I solved it by using another approach to my test project.