0

How To Accept Values In InputStreamReader And BufferedReader

JAVA

25th Nov 2016, 5:16 PM
ERFIRE
ERFIRE - avatar
7 Answers
+ 2
try(BufferedReader br = new BufferedReader (new InputStreamReader(System.in)); String name = br.readLine(); int age = Integer.parseInt(br.readLine()); }catch(Exception e){ e.printStackTrace(); }
26th Nov 2016, 4:18 AM
Ivan Khanevich
Ivan Khanevich - avatar
+ 1
what do you need to do?
26th Nov 2016, 4:09 AM
Ivan Khanevich
Ivan Khanevich - avatar
0
I Want To Accept A Name And Age..What Should I Do?
26th Nov 2016, 4:11 AM
ERFIRE
ERFIRE - avatar
0
name must come first, age second. if you want another various you should swap name and age
26th Nov 2016, 4:20 AM
Ivan Khanevich
Ivan Khanevich - avatar
0
What Does printStackTrace(); Do?
26th Nov 2016, 4:21 AM
ERFIRE
ERFIRE - avatar
0
this is method for print the exception in stacktrace, if you get it
26th Nov 2016, 4:26 AM
Ivan Khanevich
Ivan Khanevich - avatar
0
are you understand?
26th Nov 2016, 4:28 AM
Ivan Khanevich
Ivan Khanevich - avatar