Code example for PrintStream

Methods: close, printf

0
	} 
	 
	// 
	private static void printStreamTest2(){ 
		try { 
			PrintStream print = new PrintStream(new FileOutputStream(new File(File.separator
						+ "home" + File.separator + "silicon" + File.separator
						+ "hello.txt"))); 
			String name = "Rollen";
			int age = 20;
			print.printf("姓名:%s. 年龄:%d.", name,age);
			print.close();
		} catch (Exception e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} 
	} 
	 
	// 
	private static void printScreen(){ 
		OutputStream out = System.out;