private and static

webmasterbeta

New Member
A couple of newbie questions:Intro to question #1...I have never programmed in JAVA and I have inherited about 6000 lines ofJAVA code (all one class) called "public class GenerateReports". Withinthis class there are 25 methods.Question #1. Except for the one constructor method, why would all the othermethods (whether private or public) be static and void? I can understandwhy a public method would be static and void, but if a private method isonly accessible within its own class why would you make it static?Question #2. The code in question is as follows:public static void main(String args[]) {if (2 != args.length) {System.err.println("Usage: java GenerateReports dataSourceName initYear");System.exit(0);}GRInstance = new GenerateReports(); //create an instance of GenerateReports so we can read the properties file.SCHEMA = DATA_SOURCE_NAME = args[0];int initYear = -1;--------------------------------------My question is with the line "SCHEMA = DATA_SOURCE_NAME = args[0];"From what I can tell main is being passed 2 arguments - dataSourceName andinitYear. First Java checks to make sure both those arguments have beenpassed and if not it prints out an error message. Next it creates an instanceof Generates Reports - a constructor. Then I get lost. The next statementlooks like an declaration and assignment statement but I can't figure itout. Is SCHEMA a type? If so I can not find any documentation in my JAVAbook.Sorry for the long question, and thanks alot for the help.
 
Back
Top