Hey
Lets see if I can explain myself correctly......
I have 2 projects, one a program and another a library.
First project is basically this, more or less (obviously it is more complicated)
//This is the main project
//Inside com.stuct:
//Global.java
package com.stuct;
public class Global
{
public static int var=4;
}
//Main program
//Inside com.program:
//main.java
package com.program;
public class main
{
public static void main(String[] args)
{
//In order to access that I currently use something like:
System.out.println(Global.var);
}
}
Thats currently my main program. Now here is the library:
//This is the library
//This is a different project than the other
//Inside com.something:
//Things.java
package com.something;
public class Things
{
public static void main(String[] args)
{
//HERE IS MY MAIN QUESTION. CAN I DO THIS:
System.out.println(Global.var);
}
}
In the section "CAN I DO THIS",is where lies my problem. Could I add that library to my main project in its build path and would the instruction I try to use in my library work? Or do I have to create the same structure with Global in my library (which to me doesnt make sense as I would be using 2 different variables even if named the same).
Thanks!