I'm learning java and now i've the following problem: I have the main method declared as
public static void main(String[] args) { ..... } Inside my main method, because it is static I can call ONLY other static method!!! Why ?
For example: I have another class
public class ReportHandler { private Connection conn; private PreparedStatement prep; public void executeBatchInsert() { .... } } So in my main class I declare a private ReportHandler rh = new ReportHandler();
But I can't call any method if they aren't static.
Where does this go wrong?
EDIT: sorry, my question is: how to 'design' the app to allow me to call other class from my 'starting point' (the static void main).
rh.executeBatchInsert()does not work? Some error message? Which?