Morash
04-07-2014, 05:43 PM
How To Take Input From Keyboard In Java
Input Method In Java Is Different From C++ . For Input In Java We Have To Import Scanner Class From java.util Package To Read Input From System.in. And Then In Main Class We Create Object Of The Scanner For Input Method.
Lines Started With // Are Comments Just For Your Understanding. Feel Free To Ask If There Is Any Problem.
http://i61.tinypic.com/m7b02d.jpg
Output
http://i59.tinypic.com/2u4347o.jpg
Input Method In Java Is Different From C++ . For Input In Java We Have To Import Scanner Class From java.util Package To Read Input From System.in. And Then In Main Class We Create Object Of The Scanner For Input Method.
Lines Started With // Are Comments Just For Your Understanding. Feel Free To Ask If There Is Any Problem.
http://i61.tinypic.com/m7b02d.jpg
Output
http://i59.tinypic.com/2u4347o.jpg