import java.io.*; import java.util.Properties; public class Input { // This code is nasty and not exception safe. Just demo code! public static void main(String[] args) throws Exception { InputStream stream = Input.class.getResourceAsStream("SomeTextFile.txt"); InputStreamReader is=new InputStreamReader(stream); BufferedReader br =new BufferedReader(is); String str=null; while ((str = br.readLine()) != null) { System.out.println(str); } } }
D:\myjava>javac Input.java
D:\myjava>java Input
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)