title: <identifier> expected in Java
body: <p>I am trying to load the data from the properties file in my class.But i am getting error <code>&lt;identifier&gt; expected</code>.I am not getting what i have done wrong in this please suggest me what i have done wrong.</p>
  
  <pre><code>public class ToDoList {
  
    private Properties prop = new Properties();
    {
          prop.load(this.getClass().getClassLoader().getResourceAsStream("file.properties"));//Here i am getting the error
    }
    catch (IOException ioe)
    {
      ioe.printStackTrace();
    }
  }
  </code></pre>
  
  <p>Error is like </p>
  
  <pre><code>&lt;identifier&gt; expected
  illegal start of type
  ')' expected
  ';' expected
  illegal start of type
  &lt;identifier&gt; expected
  ';' expected
  invalid method declaration; return type required
  ';' expected
  </code></pre>