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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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!
;JOOP!
>>The only difference is that I am trying to use it via an abstract interface.
The following should work fine too
The following should work fine too
public interface Foo {
public final static boolean bar; // (first 3 modifiers redundant in reality)
}
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
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");
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?
ASKER
The other class is Network Systems.
That's not a class name. Class names can't contain spaces
ASKER
CEHJ, correction NetworkSystems
ASKER
thanks, this is not a big issue for me now. I solved it by using another approach to my test project.
ASKER