_118_Java_标准输入输出流

----------------------------------

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.junit.Test;

public class _001_StandardInputOrOutputStream {
	
	@Test
	public void test() {
		InputStream in = System.in;
		InputStreamReader isr= new InputStreamReader(in);
		BufferedReader br = new BufferedReader(isr);
		try {
			String readLine = br.readLine();
			System.out.println(readLine);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally {
			if(br!=null) {
				try {
					br.close();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		
		
		
	}
	
}

 

相关文章:

  • 2022-12-23
  • 2022-02-22
  • 2021-12-04
  • 2021-07-16
  • 2021-04-29
  • 2022-12-23
  • 2021-05-20
  • 2021-09-15
猜你喜欢
  • 2021-06-02
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
  • 2021-08-22
  • 2021-05-25
  • 2022-12-23
相关资源
相似解决方案