Answers for "read input using bufferedreader in java"

3

how to read integer input using bufferedreader java

BufferedReader reader =new BufferedReader(new InputStreamReader(System.in));
int num = Integer.parseInt(reader.readLine());
Posted by: Guest on November-22-2020
5

java read file bufferedreader

try {
	File file = new File("data.txt");
	BufferedReader reader = new BufferedReader(new FileReader(file));
	String line;

	while((line = reader.readLine()) != null) {
	 	 System.out.println(line);
	}
} catch(IOException e) {
  	e.printStackTrace();
}
Posted by: Guest on June-22-2020

Code answers related to "read input using bufferedreader in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language