[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 591
  • Last Modified:

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?
0
chima
Asked:
chima
  • 6
  • 4
1 Solution
 
CEHJCommented:
There's no difference. Please post code of how you're trying to access it
0
 
chimaAuthor Commented:
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.
0
 
chimaAuthor Commented:
The only difference is that I am trying to use it via an abstract interface.  Tomorrow I will try it outside of it.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
sciuriwareCommented:
Please publish any error messages (literally).

;JOOP!
0
 
CEHJCommented:
>>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

0
 
chimaAuthor Commented:
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

0
 
CEHJCommented:
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?
0
 
chimaAuthor Commented:
The other class is Network Systems.
0
 
CEHJCommented:
That's not a class name. Class names can't contain spaces
0
 
chimaAuthor Commented:
CEHJ, correction NetworkSystems
0
 
chimaAuthor Commented:
thanks, this is not a big issue for me now.  I solved it by using another approach to my test project.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now