1: …… 2: public void f(Properties cfg) throws IOException { 3: FileInputStream fis; 4: String subject = cfg.getProperty("subject"); 5: 6: if (subject.equals("math" )) 7: fis = new FileInputStream("math"); 8: else if (subject.equals("physics")) 9: fis = new FileInputStream("physics" ); 10: else if (subject.equals("chemistry" )) 11: fis = new FileInputStream("chemistry"); 12: else 13: fis = new FileInputStream("default"); 14: 15: byte[] arr = new byte[30]; 16: fis.read(arr); 17: System.out.println(arr); 18: …… 19: }