title: How load a txt file using ClassLoader?
body: <p>I have the following code:</p>
  
  <pre><code> public class App {
     public static void main(String[] args) {
       System.out.println(App.class.getClassLoader().getResource("test.properties"));
       System.out.println(App.class.getClassLoader().getResource("test.txt"));
       System.out.println(App.class.getClassLoader().getResourceAsStream("test.properties"));
       System.out.println(App.class.getClassLoader().getResourceAsStream("test.txt"));
       System.out.println(App.class.getResourceAsStream("test.properties"));
       System.out.println(App.class.getResourceAsStream("test.txt"));
     }
   }
  </code></pre>
  
  <p>This code gives the following output:</p>
  
  <pre><code>file:/C:/../test.properties 
  null 
  java.io.BufferedInputStream@18e2b22 
  null 
  java.io.BufferedInputStream@1cb1c5fa 
  null 
  </code></pre>
  
  <p>Why does ClassLoader refuses to load .txt file?</p>
  
  <p>Updated:</p>
  
  <p><strong>I'm sure that both of my files in the classpath. Classpath is set to /src and both files are in this directory.</strong></p>