F
frank
Was wondering what might be the better way to do something in java. I
have a class of static methods that are a library and I want to use the
java. To do that I need to use the log variable I have setup already.
What is the best way to initialize and use that in the methods?
1. Create an instance variable in the static class lib for log and do a
new on the thing when start my program
_util = new JBFSAUtility(logger);
....
static Logger logger;
JBFSAUtility(Logger l)
{
logger = l;
}
......
2. Pass the log variable to each method?
JBFSAUtility.method1(Logger l);
Thanks,
Frank
have a class of static methods that are a library and I want to use the
java. To do that I need to use the log variable I have setup already.
What is the best way to initialize and use that in the methods?
1. Create an instance variable in the static class lib for log and do a
new on the thing when start my program
_util = new JBFSAUtility(logger);
....
static Logger logger;
JBFSAUtility(Logger l)
{
logger = l;
}
......
2. Pass the log variable to each method?
JBFSAUtility.method1(Logger l);
Thanks,
Frank