Link to home
Start Free TrialLog in
Avatar of tonelm54
tonelm54

asked on

non-static method

Hopefully this will be my last post here for Java!!!!

I have written a method (VB programming coming in here!)
which is called by "car31.setRegistationNumber(getReadInput("What is the Cars registration number?"));"
however get a "non-static method" error on every line I use this on, I cannot understand this error!!!


  private String getReadInput(String outPutTest)
  {
    System.out.print(outPutTest);
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    try {
      String keyRet = in.readLine();
      return keyRet;
    }
    catch(Exception e) {
      e.printStackTrace();
      return "-1";
    }

  }
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
(if this is called from another static method, e.g. main)
Avatar of tonelm54
tonelm54

ASKER

God Dam it 'CEHJ' are you like a Java god or something lol!!!!!!

Every question Ive asked on the subject Java you have answered!!!!

Thanks!


Tony
:-)