I have a class like:
public class SomeClassImpl implements SomeClass {
private static final SomeLib someLib = new SomeLib();
}
I can\'t
This sample code will gives you an idea on initializing multiple varibales with out using static method:
public class SomeClass implements SomeOtherClass{
private String string1= getValues("/var/log/log1.txt");
private String component = getValues("/var/log/log2.txt");
private String getValues(String file) {
try {
return new Scanner(new File(file)).next();
}catch(FileNotFoundException ioe){
System.out.println("File not found :: " +ioe);
}
return null;
}